Android Date Format getCurrentYear()

Here you can find the source of getCurrentYear()

Description

get Current Year

Declaration

public static String getCurrentYear() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String getCurrentYear() {
        return getFormatCurrentTime("yyyy");
    }//from w  w  w .ja  va2s. c  om

    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. getCurrentDay()
  2. getCurrentDayOfWeek()
  3. getCurrentFormatedDate()
  4. getCurrentMonth()
  5. getCurrentTime()
  6. getDateEN()
  7. getDefaultFormatter(Date date)
  8. getFormatCurrentAdd(int amount, String format)
  9. getFormatCurrentTime(String format)