Java tutorial
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static int getMonthOfYear(Date time) { Calendar calendar = Calendar.getInstance(); calendar.setTime(time); return calendar.get(Calendar.MONTH); } }