Here you can find the source of getMonth(String dateTime)
public static int getMonth(String dateTime)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static int getMonth(String dateTime) { Calendar c = Calendar.getInstance(); c.setTime(getDateTime(dateTime)); int month = c.get(2) + 1; return month; }/*w w w . java 2 s . c o m*/ public static java.util.Date getDateTime(String dateTime) { java.util.Date strDate = java.sql.Date.valueOf(dateTime); return strDate; } }