Java Year Get getYear(Date date)

Here you can find the source of getYear(Date date)

Description

get Year

License

Open Source License

Declaration

public static String getYear(Date date) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

public class Main {

    public static String getYear(Date date) {
        return FormatDate(date, "yyyy");
    }/*from www  . j  a v  a  2 s  . com*/

    public static String FormatDate(Date date, String sf) {
        if (date == null)
            return "";
        SimpleDateFormat dateformat = new SimpleDateFormat(sf);
        return dateformat.format(date);
    }
}

Related

  1. getYear()
  2. getYear()
  3. getYear(Date d)
  4. getYear(Date date)
  5. getYear(Date date)
  6. getYear(Date date)
  7. getYear(Date date)
  8. getYear(Date date)
  9. getYear(Date date)