Here you can find the source of getFirstDayStringOfMonth(Date date)
Parameter | Description |
---|---|
date | a parameter |
public static String getFirstDayStringOfMonth(Date date)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String format2 = "yyyy-MM"; public static String getFirstDayStringOfMonth(Date date) { if (null == date) return null; return getFormateDateString(date, format2); }/*from w w w . java2 s . c om*/ public static String getFormateDateString(Date date, String format) { if (date == null) return null; SimpleDateFormat dateFormat = new SimpleDateFormat(format); return dateFormat.format(date); } }