Java examples for java.util:Year
get Last Day Of Year
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static void main(String[] argv) throws Exception { Date date = new Date(); System.out.println(getLastDayOfYear(date)); }/*w w w. j a v a 2s .c om*/ public static String getLastDayOfYear(Date date) { SimpleDateFormat sf = new SimpleDateFormat("yyyy-12-31"); return sf.format(date); } }