Here you can find the source of getCurrYearFirstDay(int year)
public static String getCurrYearFirstDay(int year)
//package com.java2s; /*/*ww w. j ava 2s .c om*/ * Copyright 2012-2014 sammyun.com.cn. All rights reserved. * Support: http://www.sammyun.com.cn * License: http://www.sammyun.com.cn/license */ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { private static String default_format = "yyyy-MM-dd"; public static String getCurrYearFirstDay(int year) { SimpleDateFormat format = new SimpleDateFormat(default_format); Calendar calendar = Calendar.getInstance(); calendar.clear(); calendar.set(Calendar.YEAR, year); Date currYearFirst = calendar.getTime(); return format.format(currYearFirst); } }