Code
import calendardef JulianDate_to_MMDDYYY(y,jd):month = 1day = 0while jd - calendar.monthrange(y,month)[1] > 0 and month <= 12:jd = jd - calendar.monthrange(y,month)[1]month = month + 1print month,jd,yJulianDate_to_MMDDYYY(2008,167)
Result:
6 15 2008
Check Code:
from datetime import dated0 = date(2008, 1, 1)d1 = date(2008, 6, 15)delta = d1 - d0print delta.days+1
Result:
167
Recherches associées
| Liens | Site |
|---|---|
| Julian Day Calendar | landweb |
| Calendar date | wikipedia |
| Extract day of year and Julian day from a string date in python | stackoverflow |
| Convert julian day into date | stackoverflow |
| Days between two dates in Python | stackoverflow |
| How do I calculate number of days betwen two dates using Python? | stackoverflow |
