Here you can find the source of getMonthOfYearFromTimestamp(long ms)
public static int getMonthOfYearFromTimestamp(long ms) throws NumberFormatException
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Locale; import java.util.TimeZone; public class Main { public static final TimeZone TIMEZONE = TimeZone.getTimeZone("UTC"); public static final Locale LOCALE = new Locale("sv", "SE"); public static int getMonthOfYearFromTimestamp(long ms) throws NumberFormatException { if (ms < 0) throw new NumberFormatException("argument must be positive"); Calendar cal = Calendar.getInstance(TIMEZONE, LOCALE); cal.setTimeInMillis(ms);/*www. j a v a2s . c o m*/ return cal.get(Calendar.MONTH); } }