Java Month Day getFirstDayStringOfMonth(Date date)

Here you can find the source of getFirstDayStringOfMonth(Date date)

Description

get First Day String Of Month

License

Open Source License

Parameter

Parameter Description
date a parameter

Return

String

Declaration

public static String getFirstDayStringOfMonth(Date date) 

Method Source Code

//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);
    }
}

Related

  1. getFirstDayOfMonth(Date date)
  2. getFirstDayOfMonth(Date date)
  3. getFirstDayOfMonth(Date date)
  4. getFirstDayOfMonth(Long date)
  5. getFirstDayOfNextMonth()
  6. getFirstDayStrOfMonth(Date date)
  7. getLastMonthDay()
  8. getLastMonthLastDate()
  9. getLastMonthLastDay()