Here you can find the source of getCurrentYearMonthDay()
public static int[] getCurrentYearMonthDay()
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static int[] getCurrentYearMonthDay() { return getYearMonthDay(new Date()); }//from w w w . j a v a2 s . c o m public static int[] getYearMonthDay(Date date) { Calendar bgnDate = Calendar.getInstance(); bgnDate.setTime(date); return new int[] { bgnDate.get(Calendar.YEAR), bgnDate.get(Calendar.MONTH) + 1, bgnDate.get(Calendar.DATE) }; } }