Here you can find the source of getMonth(Date date)
Parameter | Description |
---|---|
date | a parameter |
public static int getMonth(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static int getMonth(Date date) { Calendar cld = Calendar.getInstance(); cld.setTime(date);/*from w w w .j a va2 s .c o m*/ return cld.get(Calendar.MONTH) + 1; } }