def dt2jd ( dt ) : a = ( 14 - dt . month ) // 12 y = dt . year + 4800 - a m = dt . month + 12 * a - 3 return dt . day + ( ( 153 * m + 2 ) // 5 ) + 365 * y + y // 4 - y // 100 + y // 400 - 32045
date to jday python
Convert datetime to julian date
def dt2jd(dt):
    """Convert datetime to julian date
    """
    a = (14 - dt.month)//12
    y = dt.year + 4800 - a
    m = dt.month + 12*a - 3
    return dt.day + ((153*m + 2)//5) + 365*y + y//4 - y//100 + y//400 - 32045