Here you can find the source of getYYYY(java.util.Date date)
static public String getYYYY(java.util.Date date)
//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 }