Here you can find the source of getMonth()
public static String getMonth() throws ParseException
//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 }