Calendar.getInstance().getActualMaximum(Calendar.DAY_OF_MONTH);
This returns actual maximum for current month. For example it is February of leap year now, so it returns 29 as int
.
More Related Contents:
- Number of days in particular month of particular year?
- How to subtract X day from a Date object in Java?
- Convert String to Calendar Object in Java
- How to change TIMEZONE for a java.util.Calendar/Date
- Understanding java.util.Calendar WEEK_OF_YEAR [duplicate]
- Why is January month 0 in Java Calendar?
- Is java.sql.Timestamp timezone specific?
- Convert java.util.Date to java.time.LocalDate
- How to handle calendar TimeZones using Java?
- Converting between java.time.LocalDateTime and java.util.Date
- Convert timestamp in milliseconds to string formatted time in Java
- How to compare two Dates without the time portion?
- Converting a date string to a DateTime object using Joda Time library
- Check if a given time lies between two times regardless of date
- How to calculate elapsed time from now with Joda-Time?
- Creating java date object from year,month,day
- System.currentTimeMillis() vs. new Date() vs. Calendar.getInstance().getTime()
- Best way to compare dates in Android
- Can’t parse String to LocalDate (Java 8)
- Why were most java.util.Date methods deprecated?
- Convert Java Date to UTC String
- Java Timestamp – How can I create a Timestamp with the date 23/09/2007?
- DateFormat parse – not return date in UTC
- How to get the current date and time
- A good date converter for Jalali Calendar in Java? [closed]
- Format a date using the new date time API
- Get the number of days, weeks, and months, since Epoch in Java
- Does Java 8’s new Java Date Time API take care of DST?
- Date object to Calendar [Java]
- calculate business days including holidays