Java Month Day getCurretnMonthFirstDay()

Here you can find the source of getCurretnMonthFirstDay()

Description

get Curretn Month First Day

License

Apache License

Declaration

public static String getCurretnMonthFirstDay() 

Method Source Code

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

Related

  1. firstDayOfMonth(Date date)
  2. firstMonthDay(String dateTime, int num)
  3. getActualMaximumDayOfMonth(final Date date)
  4. getCurMonthFirstDay()
  5. getCurrentDayOfMonth()
  6. getCurrMonthFirstDay()
  7. getDayOfMonth()
  8. getDaysInMonth(final Date date)
  9. getDaysOfMonth(Date date)