public static long fieldsToDay ( int year , int month , int dom ) { int y = year - 1 ; long julian = 365 * y + floorDivide ( y , 4 ) + ( JULIAN_1_CE - 3 ) + // Julian cal floorDivide ( y , 400 ) - floorDivide ( y , 100 ) + 2 + // => Gregorian cal DAYS_BEFORE [ month + ( isLeapYear ( year ) ? 12 : 0 ) ] + dom ; // => month/dom return julian - JULIAN_1970_CE ; // JD => epoch day }
Convert a year month and day - of - month given in the proleptic Gregorian calendar to 1970 epoch days .