Here you can find the source of getFirstYearMonth()
public static String getFirstYearMonth()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getFirstYearMonth() { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-01-1"); Date curDate = new Date(System.currentTimeMillis()); return formatter.format(curDate); }/*from ww w .j a v a 2 s . co m*/ }