Here you can find the source of getEndTimeOfYear(int year)
public static long getEndTimeOfYear(int year)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static long getEndTimeOfYear(int year) { Calendar cal = Calendar.getInstance(); cal.set(year + 1, Calendar.JANUARY, 1, 23, 59, 59); return cal.getTimeInMillis() - 24 * 60 * 60 * 1000; }/*from ww w. j av a 2 s. c o m*/ }