SyntaxFix
Write A Post
Hire A Developer
Questions
Alternatively, with the Joda-Time DateTime class.
DateTime
//convert date to datetime DateTime datetime = new DateTime(date); int month = Integer.parseInt(datetime.toString("MM"))
…or…
int month = dateTime.getMonthOfYear();