Java Month Convert month()

Here you can find the source of month()

Description

month

License

Open Source License

Declaration

public static String month() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.GregorianCalendar;

public class Main {
    public static String month() {
        return now("MM");
    }/*from  ww  w .  java2s  .c o m*/

    public static String now(String s) {
        SimpleDateFormat simpledateformat = new SimpleDateFormat(s);
        Date date = new Date();
        GregorianCalendar gregoriancalendar = new GregorianCalendar();
        gregoriancalendar.setTime(date);
        Date date1 = gregoriancalendar.getTime();
        String s1 = simpledateformat.format(date1);
        return s1;
    }

    public static String now(String s, Date date) {
        SimpleDateFormat simpledateformat = new SimpleDateFormat(s);
        String s1 = simpledateformat.format(date);
        return s1;
    }

    public static String now() {
        return now("yyyy-MM-dd HH:mm:ss");
    }
}

Related

  1. convertToMonth_long(int month)
  2. convertToNumericMonth(String importStrMonth)
  3. createFutureDate(int days, int months)
  4. differenceMonth(String strDate1, String strDate2)
  5. isCurMonth(String month)
  6. month(Date date, Locale locale)
  7. month2String(Date date)
  8. monthAgo()
  9. monthConvertToNumber(String str)