Next Previous Up Contents
Next: TrigDegrees
Up: General Functions
Previous: KCorrections
Functions for conversion of time values between various forms.
The forms used are

Modified Julian Date (MJD)
 A continuous measure in days since midnight at the start of
17 November 1858. Based on UTC.

ISO 8601
 A string representation of the form
yyyymmddThh:mm:ss.s
, where the T
is a literal character (a space character may be used instead).
Based on UTC.

Julian Epoch
 A continuous measure based on a Julian year of exactly 365.25 days.
For approximate purposes this resembles the fractional number
of years AD represented by the date. Sometimes (but not here)
represented by prefixing a 'J'; J2000.0 is defined as
2000 January 1.5 in the TT timescale.

Besselian Epoch
 A continuous measure based on a tropical year of about 365.2422 days.
For approximate purposes this resembles the fractional number of
years AD represented by the date. Sometimes (but not here)
represented by prefixing a 'B'.

Decimal Year
 Fractional number of years AD represented by the date.
2000.0, or equivalently 1999.99recurring, is midnight at the start
of the first of January 2000. Because of leap years, the size of
a unit depends on what year it is in.
Therefore midday on the 25th of October 2004 is
20041025T12:00:00
in ISO 8601 format,
53303.5 as an MJD value,
2004.81588 as a Julian Epoch and
2004.81726 as a Besselian Epoch.
Currently this implementation cannot be relied upon to
better than a millisecond.

isoToMjd( isoDate )
 Converts an ISO8601 date string to Modified Julian Date.
The basic format of the
isoDate
argument is
yyyymmddThh:mm:ss.s
, though some deviations
from this form are permitted:
 The '
T
' which separates date from time
can be replaced by a space
 The seconds, minutes and/or hours can be omitted
 The decimal part of the seconds can be any length,
and is optional
 A '
Z
' (which indicates UTC) may be appended
to the time
Some legal examples are therefore:
"19941221T14:18:23.2
",
"19680114
", and
"21120525 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.

decYearToMjd( decYear )
 Converts a Decimal Year to a Modified Julian Date.

mjdToIso( mjd )
 Converts a Modified Julian Date value to an ISO 8601format datetime
string. The output format is
yyyymmddThh:mm:ss
.

mjdToDate( mjd )
 Converts a Modified Julian Date value to an ISO 8601format date
string. The output format is
yyyymmdd
.

mjdToTime( mjd )
 Converts a Modified Julian Date value to an ISO 8601format timeonly
string. The output format is
hh:mm:ss
.

mjdToDecYear( mjd )
 Converts a Modified Julian Date to Decimal Year.

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
"yyyyMMdd'T'HH:mm:ss
"

mjdToJulian( mjd )
 Converts a Modified Julian Date to Julian Epoch.
For approximate purposes, the result
of this routine consists of an integral part which gives the
year AD and a fractional part which represents the distance
through that year, so that for instance 2000.5 is approximately
1 July 2000.

julianToMjd( julianEpoch )
 Converts a Julian Epoch to Modified Julian Date.
For approximate purposes, the argument
of this routine consists of an integral part which gives the
year AD and a fractional part which represents the distance
through that year, so that for instance 2000.5 is approximately
1 July 2000.

mjdToBesselian( mjd )
 Converts Modified Julian Date to Besselian Epoch.
For approximate purposes, the result
of this routine consists of an integral part which gives the
year AD and a fractional part which represents the distance
through that year, so that for instance 1950.5 is approximately
1 July 1950.

besselianToMjd( besselianEpoch )
 Converts Besselian Epoch to Modified Julian Date.
For approximate purposes, the argument
of this routine consists of an integral part which gives the
year AD and a fractional part which represents the distance
through that year, so that for instance 1950.5 is approximately
1 July 1950.

unixMillisToMjd( unixMillis )
 Converts from milliseconds since the Unix epoch (19700101T00:00:00)
to a modified Julian date value

mjdToUnixMillis( mjd )
 Converts from modified Julian date to milliseconds since the Unix
epoch (19700101T00:00:00).
Next Previous Up Contents
Next: TrigDegrees
Up: General Functions
Previous: KCorrections
TOPCAT  Tool for OPerations on Catalogues And Tables
Starlink User Note253
TOPCAT web page:
http://www.starlink.ac.uk/topcat/
Author email:
m.b.taylor@bristol.ac.uk
Mailing list:
topcatuser@jiscmail.ac.uk