Here you can find the source of getYear(Date date)
public static final int getYear(Date date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { public static final int getYear(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date);/* w w w . j av a 2 s. c o m*/ return calendar.get(1); } public static final int getYear(long millis) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(millis); return calendar.get(1); } }