Java Month Get getMonth()

Here you can find the source of getMonth()

Description

get Month

License

Apache License

Declaration

public static String getMonth() throws ParseException 

Method Source Code

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

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Locale;

public class Main {

    public static String getMonth() throws ParseException {
        Date date = new Date();
        SimpleDateFormat formatter;
        String pattern = "MM";
        formatter = new SimpleDateFormat(pattern, new Locale("ko", "KOREA"));

        return formatter.format(date);
    }//from  w  w w  . j  ava  2 s.  c om
}

Related

  1. getMonth()
  2. getMonth()
  3. getMonth()
  4. getMonth()
  5. getMonth()
  6. getMonth()
  7. getMonth()
  8. getMonth()
  9. getMonth(Date d)