Java examples for java.util:Year
get First 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(getFirstDayOfYear(date)); }// w w w. ja v a 2 s.c o m public static String getFirstDayOfYear(Date date) { SimpleDateFormat sf = new SimpleDateFormat("yyyy-01-01"); return sf.format(date); } }