Here you can find the source of getYear(long dateTimeMillis)
public static int getYear(long dateTimeMillis)
//package com.java2s; import java.text.SimpleDateFormat; public class Main { public static int getYear(long dateTimeMillis) { SimpleDateFormat format = new SimpleDateFormat("yyyy"); StringBuilder dateString = new StringBuilder( format.format(dateTimeMillis)); return Integer.parseInt(dateString.toString()); }/* www . j av a 2s . c om*/ }