Here you can find the source of getCurretnMonthFirstDay()
public static String getCurretnMonthFirstDay()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { /**/*from w w w . j a va 2 s . co m*/ * yyyy-MM-dd Comment for <code>onlyDateFmt</code> */ public static final SimpleDateFormat onlyDateFmt = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA); public static String getCurretnMonthFirstDay() { String current = getCurrentStringDate(); return current.substring(0, 7) + "-01"; } public static String getCurrentStringDate() { return onlyDateFmt.format(getCurrentDate()); } public static Date getCurrentDate() { return new Date(System.currentTimeMillis()); } }