def to_jd(year, month, day):
if year >= <NUM_LIT:0>:<EOL><INDENT>y = <NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>y = <NUM_LIT><EOL><DEDENT>epbase = year - y<EOL>epyear = <NUM_LIT> + (epbase % <NUM_LIT>)<EOL>if month <= <NUM_LIT:7>:<EOL><INDENT>m = (month - <NUM_LIT:1>) * <NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>m = (month - <NUM_LIT:1>) * <NUM_LIT:30> + <NUM_LIT:6><EOL><DEDENT>return day + m + trunc(((epyear * <NUM_LIT>) - <NUM_LIT>) / <NUM_LIT>) + (epyear - <NUM_LIT:1>) * <NUM_LIT> + trunc(epbase / <NUM_LIT>) * <NUM_LIT> + (EPOCH - <NUM_LIT:1>)<EOL>
Determine Julian day from Persian date