Next Previous Up Contents
Next: Strings
Up: Functions
Previous: Functions

4.4.1 Times

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 )
Converts an ISO8601 date string to Modified Julian Date. The basic format of the isoDate argument is yyyy-mm-ddThh:mm:ss.s, though some deviations from this form are permitted: Some legal examples are therefore: "1994-12-21T14:18:23.2", "1968-01-14", and "2112-05-25 16:45Z".
dateToMjd( year, month, day, hour, min, sec )
Converts a calendar date and time to Modified Julian Date.
dateToMjd( year, month, day )
Converts a calendar date to Modified Julian Date.
mjdToIso( mjd )
Converts a Modified Julian Date value to an ISO 8601-format date-time string. The output format is yyyy-mm-ddThh:mm:ss.
mjdToDate( mjd )
Converts a Modified Julian Date value to an ISO 8601-format date string. The output format is yyyy-mm-dd.
mjdToTime( mjd )
Converts a Modified Julian Date value to an ISO 8601-format time-only string. The output format is hh:mm:ss.
formatMjd( mjd, format )
Converts a Modified Julian Date value to a date using a customisable date format. The format is as defined by the java.text.SimpleDateFormat class. The default output corresponds to the string "yyyy-MM-dd'T'HH:mm:ss"


Next Previous Up Contents
Next: Strings
Up: Functions
Previous: Functions

STILTS - Starlink Tables Infrastructure Library Tool Set
Starlink User Note 256
STILTS web page: http://www.starlink.ac.uk/stilts/
Author email: m.b.taylor@bristol.ac.uk