Here you can find the source of getMonth(long dateTimeMillis)
public static int getMonth(long dateTimeMillis)
//package com.java2s; import java.text.SimpleDateFormat; public class Main { public static int getMonth(long dateTimeMillis) { SimpleDateFormat format = new SimpleDateFormat("MM"); StringBuilder dateString = new StringBuilder( format.format(dateTimeMillis)); return Integer.parseInt(dateString.toString()) - 1; }//from w w w . j a v a2 s .c o m }