Android Month String Get getCurrentMonth()

Here you can find the source of getCurrentMonth()

Description

get Current Month

License

Apache License

Declaration

public static String getCurrentMonth() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String getCurrentMonth() {
        return getFormatCurrentTime("MM");
    }// w  w w  .  java 2s .c o m

    public static String getFormatCurrentTime(String format) {
        return getFormatDateTime(new Date(), format);
    }

    public static String getFormatDateTime(Date date, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }
}

Related

  1. getLastMonthStr()
  2. getMonthBefore(String format)
  3. getMonthString(int month, int abbrev)
  4. getMonthStringByIndex(int index)
  5. getReadableMonth(int month)
  6. getMonthNames()
  7. getMonthNames(Locale l, int len)
  8. getShortMonths()
  9. getShortMonthString(int month)