Here you can find the source of monthMillis(int year, int monthNum)
public static long monthMillis(int year, int monthNum)
//package com.java2s; //License from project: Apache License public class Main { public static long monthMillis(int year, int monthNum) { if (monthNum == 13) { year += 1;/*from ww w .j av a 2s. co m*/ monthNum = 0; } monthNum += 1; if (monthNum == 2) { if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) { return (long) 1000 * 60 * 60 * 24 * 29; } else { return (long) 1000 * 60 * 60 * 24 * 28; } } else if (monthNum == 1 || monthNum == 3 || monthNum == 5 || monthNum == 7 || monthNum == 8 || monthNum == 10 || monthNum == 12) { return (long) 1000 * 60 * 60 * 24 * 31; } else { return (long) 1000 * 60 * 60 * 24 * 30; } } }