Java Date Time Java Java API
java.time.YearMonth
public int lengthOfMonth()
Returns the length of the month.
package com.logicbig.example.yearmonth;import java.time.YearMonth;public class LengthOfMonthExample { public static void main(String... args) { YearMonth y = YearMonth.of(2010, 2); System.out.println(y); int l = y.lengthOfMonth(); System.out.println(l); }}
2010-0228