Slight amendment of one of my previous posts. Cheers
# ------- jul1bis.py -------- import julian import datetime mjd = 58370.5084722222 dt = julian.from_jd(mjd, fmt='mjd') print(dt) # mjd2 = julian.to_jd(dt + datetime.timedelta(hours=0), fmt='jd') - 2400000.5 print(mjd2) # ------- OUTPUTS ----------- # C:\Training>python jul1bis.py # 2018-09-09 12:12:12.000012 # 58370.50847222237 # My comments: line 8 been amended with (hours=0, scaletime of MJD), # so the back calculated (mjd2) fully matches (mjd) of line 4 # -------------------------------------------------------------------