Java: Get Last Day Of The Month

With Java’s API now, getting the last day of a month is pretty easy. Say, you want to get the last day of the current Month. We use the Calendar class to create an instance object of it and we pass that object to the method’s parameter. I made a simple method for this. Notice that the Calendar’s time is set to 1 second prior to the next day. It is up to you if you want to leave the time as is. The method returns a java.util.Date object.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

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