Fetching the last day of the month

21 / Aug / 2009 by Chandan Luthra 2 comments

Note: Months are from 0 to 11. Hence the 7th month is “August”

Calendar calendar = GregorianCalendar.instance
calendar.set(2009, 7, 21)
println "Last Day of a Month: ${calendar.getActualMaximum(GregorianCalendar.DAY_OF_MONTH)}"

Cheers!!!
~Chandan Luthra~
chandan@intelligrape.com
www.intelligrape.com

FOUND THIS USEFUL? SHARE IT

comments (2)

Leave a Reply

Your email address will not be published. Required fields are marked *