Android Year Get getCurrentYear()

Here you can find the source of getCurrentYear()

Description

get Current Year

License

Apache License

Declaration

public static String getCurrentYear() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String getCurrentYear() {
        return getFormatCurrentTime("yyyy");
    }/* w  w  w. j  a v a2s. co m*/

    public static String getFormatCurrentTime(String format) {
        return getFormatDateTime(new Date(), format);
    }

    public static String getFormatDateTime(Date date, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }
}

Related

  1. getIndexYear(Date origin, int index)
  2. getCurrentYear()
  3. getCurrentYear()
  4. getBeforeYear()
  5. isInCurrentYear(long lTime)
  6. getCurrentYear()
  7. getYear()