Here you can find the source of getNowMonth()
@SuppressWarnings("deprecation") public static String getNowMonth()
//package com.java2s; import java.util.*; public class Main { @SuppressWarnings("deprecation") public static String getNowMonth() { Date date = new Date(); int year = date.getYear() + 1900; int month = date.getMonth() + 1; return year + "-" + (month < 10 ? "0" : "") + month; }//from w ww. j av a2 s.c om @SuppressWarnings("deprecation") public static int getMonth(int i) { return getCurrentDate().getMonth(); } public static Date getCurrentDate() { return new Date(System.currentTimeMillis()); } }