List of usage examples for java.util Calendar MONTH
int MONTH
To view the source code for java.util Calendar MONTH.
Click Source Link
get
and set
indicating the month. From source file:Main.java
public static String calendar2str(Calendar c) { int year = c.get(Calendar.YEAR); int month = c.get(Calendar.MONTH) + 1; int day = c.get(Calendar.DAY_OF_MONTH); return year + "-" + month + "-" + day; }
From source file:Main.java
public static int getNowMonthOfYear() { return Calendar.getInstance().get(Calendar.MONTH); }
From source file:Main.java
public static int getDayOfMonth(int offset) { Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.MONTH, offset); return calendar.get(Calendar.DAY_OF_MONTH); }
From source file:Main.java
public static int getMonth() { return (getCalendar(getCurrentDate()).get(Calendar.MONTH) + 1); }
From source file:Main.java
public static int getCurrentMonthOfYear() { Calendar calendar = Calendar.getInstance(); return calendar.get(Calendar.MONTH); }
From source file:Main.java
public static String getDateYYYYMM(int offset) { Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.MONTH, offset); return calendar.get(Calendar.YEAR) + "-" + calendar.get(Calendar.MONTH); }
From source file:Util.java
public static Date getLastMonthLastDate() { Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.MONTH, -1); int max = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); calendar.set(Calendar.DAY_OF_MONTH, max); return calendar.getTime(); }
From source file:Main.java
public static int getCurrentSeason() { Calendar c = Calendar.getInstance(); int month = c.get(Calendar.MONTH); if (month >= 0 && month < 3) { return 1; } else if (month > 3 && month < 6) { return 2; } else if (month > 6 && month < 9) { return 3; }/*from w w w. j a v a 2s . c o m*/ return 4; }
From source file:Main.java
public static int getCurrentMonth() { return calendar.get(Calendar.MONTH) + 1; }
From source file:Main.java
public static String getCurrentMonth() { Calendar calendar = Calendar.getInstance(); return ((Integer) (calendar.get(Calendar.MONTH) + 1)).toString(); }