Functions for conversion of time values between various forms.
The two main forms used here are Modified Julian Date (MJD) and
the string format and underlying calendar model described by
ISO 8601. MJD is a continuous measure in days since
midnight at the start of 17 November 1858.
ISO 8601 format is a string representation of this of the form
yyyy-mm-ddThh:mm:ss.s
, where the T
is a literal
character. In both cases the time is UTC.
Therefore midday on the 25th of October 2004 is
53303.5 as an MJD value and
2004-10-25T12:00:00
in ISO 8601 format.
Currently this implementation does not keep track of values to better than a millisecond.
isoToMjd( isoDate )
isoDate
argument is
yyyy-mm-ddThh:mm:ss.s
, though some deviations
from this form are permitted:
T
' which separates date from time
can be replaced by a spaceZ
' (which indicates UTC) may be appended
to the time1994-12-21T14:18:23.2
",
"1968-01-14
", and
"2112-05-25 16:45Z
".isoDate
(String): date in ISO 8601 formatisoDate
dateToMjd( year, month, day, hour, min, sec )
year
(integer): year ADmonth
(integer): index of month; January is 1, December is 12day
(integer): day of month (the first day is 1)hour
(integer): hour (0-23)min
(integer): minute (0-59)sec
(floating point): second (0<=sec<60)dateToMjd( year, month, day )
year
(integer): year ADmonth
(integer): index of month; January is 1, December is 12day
(integer): day of month (the first day is 1)mjdToIso( mjd )
yyyy-mm-ddThh:mm:ss
.mjd
(floating point): modified Julian datemjd
mjdToDate( mjd )
yyyy-mm-dd
.mjd
(floating point): modified Julian datemjd
mjdToTime( mjd )
hh:mm:ss
.mjd
(floating point): modified Julian datemjd
formatMjd( mjd, format )
java.text.SimpleDateFormat
class.
The default output corresponds to the string
"yyyy-MM-dd'T'HH:mm:ss
"mjd
(floating point): modified Julian dateformat
(String): formatting pattternmjd