def to_jd2(year, month, day):
<EOL>legal_date(year, month, day)<EOL>if month <= <NUM_LIT:2>:<EOL><INDENT>year = year - <NUM_LIT:1><EOL>month = month + <NUM_LIT:12><EOL><DEDENT>a = floor(year / <NUM_LIT:100>)<EOL>b = floor(a / <NUM_LIT:4>)<EOL>c = <NUM_LIT:2> - a + b<EOL>e = floor(<NUM_LIT> * (year + <NUM_LIT>))<EOL>f = floor(<NUM_LIT> * (month + <NUM_LIT:1>))<EOL>return c + day + e + f - <NUM_LIT><EOL>
Gregorian to Julian Day Count for years between 1801-2099