Java Year Format getYYYY(java.util.Date date)

Here you can find the source of getYYYY(java.util.Date date)

Description

get YYYY

License

Apache License

Declaration

static public String getYYYY(java.util.Date date) 

Method Source Code


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

import java.text.SimpleDateFormat;

public class Main {
    static public SimpleDateFormat yyyy = new SimpleDateFormat("yyyy");

    static public String getYYYY(java.util.Date date) {
        if (date == null)
            return "";
        return yyyy.format(date);
    }//from   ww  w.  j  a v  a 2 s . com
}

Related

  1. getYear(String date, String dateformat)
  2. getYear(String pFormattedDate)
  3. getYYMMDD()
  4. getYYMMDD(int i)
  5. getYYYY()
  6. getyyyy_MM_dd(Date date)
  7. getyyyy_MM_dd2(String date)
  8. getYYYYMM()
  9. getYYYYMM(final Date date, final String separator)