Search code examples
javadatetimecalendar

how to get minimum and maximum date from given month in java


how to get minimum and maximum date from given month in java using java.util.Calendar.


Solution

  • The minimum is always the 1st of this month. The maximum can be determined by adding 1 to month and subtracting 1 from the Calendar day field.