Created
May 17, 2012 03:40
-
-
Save jfsurban/2716067 to your computer and use it in GitHub Desktop.
get last of month & get month name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int getLastDayOfMonth() { | |
Calendar c = asCalendar(); | |
// move to next month and decrement from the 1st day | |
c.add(Calendar.MONTH, 1); | |
c.set(Calendar.MONTH, 1); | |
c.roll(Calendar.MONTH, 1); | |
return c.get(Calendar.DAY_OF_MONTH); | |
} | |
public String getMonthName() { | |
return new DateFormatSymbols().getMonths()[month]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment