<<Yes, I want to modified julian date.>>
For years between 1901AD and 2099AD inclusive, the Modified Julian Date is
calculated as
MJD = -678972 + 367 * Y - 7 * (Y + (M + 9) intdivide 12) intdivide 4 - 3 *
((Y + (M - 9) intdivide 7) intdivide 100 + 1) intdivide 4 + 275 * M
intdivide 9 + D + UT floatdivide 24
'Y' is the integer value of the year, 'M' is the month (1-12), and D is the
day of the month, 1-31. 'UT' is supposed to the current universal time, UT,
in decimal hours. However, since most of us normal (or mostly-normal) humans
don't have access to up-to-date UT1 values, you can use UTC instead.
'intdivide' indicates integer division, where the remainder is dropped and
not carried forward into later calculations; 'floatdivide' is, surprisingly
enough, floating-point division where the remainder becomes the
fractional-day component of the result. This formula ignores leap-seconds,
unless incorporated into the 'UT' value used; if you need better accuracy,
include them as appropriate.
As an even greater simplification, for dates in 1997,
MJD = 50448 + DOY
Where 'DOY' is the day of the year, 1-365.
Steve
|