Here you can find the source of month(Date inDate, TimeZone timeZone)
Parameter | Description |
---|---|
inDate | The given date. |
public static int month(Date inDate, TimeZone timeZone)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { /**/*from w w w. j a v a 2 s . c om*/ * Calcuate the month number (0 - 11) for the given date. * * @param inDate The given date. * @return The month number. */ public static int month(Date inDate, TimeZone timeZone) { Calendar calendar = Calendar.getInstance(); calendar.setTimeZone(timeZone); calendar.setTime(inDate); return calendar.get(Calendar.MONTH); } }