How to get number of days in month java code, Examples?

public static int getNoOfDays(int month, int year){
    Calendar calendar = Calendar.getInstance();
    int date = 1;
    calendar.set(year, month, date);
    int days = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
    return days;
}

Comments

Recent Post

Recent Posts Widget

Popular posts from this blog

Capture image from webcam java code, examples

How to capture finger prints in java

Shallow Copy Deep Copy Java example