public class Times
extends java.lang.Object
A continuous measure in days since midnight at the start of 17 November 1858. Based on UTC.
A string representation of the form
yyyy-mm-ddThh:mm:ss.s
, where the T
is a literal character (a space character may be used instead).
Based on UTC.
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.
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'.
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
2004-10-25T12: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.
Modifier and Type | Method and Description |
---|---|
static double |
besselianToMjd(double besselianEpoch)
Converts Besselian Epoch to Modified Julian Date.
|
static double |
dateToMjd(int year,
int month,
int day)
Converts a calendar date to Modified Julian Date.
|
static double |
dateToMjd(int year,
int month,
int day,
int hour,
int min,
double sec)
Converts a calendar date and time to Modified Julian Date.
|
static double |
decYearToMjd(double decYear)
Converts a Decimal Year to a Modified Julian Date.
|
static java.lang.String |
formatMjd(double mjd,
java.lang.String format)
Converts a Modified Julian Date value to a date using a customisable
date format.
|
static double |
isoToMjd(java.lang.String isoDate)
Converts an ISO8601 date string to Modified Julian Date.
|
static double |
julianToMjd(double julianEpoch)
Converts a Julian Epoch to Modified Julian Date.
|
static double |
mjdToBesselian(double mjd)
Converts Modified Julian Date to Besselian Epoch.
|
static java.lang.String |
mjdToDate(double mjd)
Converts a Modified Julian Date value to an ISO 8601-format date
string.
|
static double |
mjdToDecYear(double mjd)
Converts a Modified Julian Date to Decimal Year.
|
static java.lang.String |
mjdToIso(double mjd)
Converts a Modified Julian Date value to an ISO 8601-format date-time
string.
|
static double |
mjdToJulian(double mjd)
Converts a Modified Julian Date to Julian Epoch.
|
static java.lang.String |
mjdToTime(double mjd)
Converts a Modified Julian Date value to an ISO 8601-format time-only
string.
|
static long |
mjdToUnixMillis(double mjd)
Converts from modified Julian date to milliseconds since the Unix
epoch (1970-01-01T00:00:00).
|
static double |
unixMillisToMjd(long unixMillis)
Converts from milliseconds since the Unix epoch (1970-01-01T00:00:00)
to a modified Julian date value
|
public static double isoToMjd(java.lang.String 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
- date in ISO 8601 formatisoDate
isoToMjd("2004-10-25T18:00:00") = 53303.75
, isoToMjd("1970-01-01") = 40587.0
public static double dateToMjd(int year, int month, int day, int hour, int min, double sec)
year
- year ADmonth
- index of month; January is 1, December is 12day
- day of month (the first day is 1)hour
- hour (0-23)min
- minute (0-59)sec
- second (0<=sec<60)dateToMjd(1999, 12, 31, 23, 59, 59.) = 51543.99998
public static double dateToMjd(int year, int month, int day)
year
- year ADmonth
- index of month; January is 1, December is 12day
- day of month (the first day is 1)dateToMjd(1999, 12, 31) = 51543.0
public static double decYearToMjd(double decYear)
decYear
- decimal yeardecYearToMjd(2000.0) = 51544.0
public static java.lang.String mjdToIso(double mjd)
yyyy-mm-ddThh:mm:ss
.mjd
- modified Julian datemjd
mjdToIso(53551.72917) = "2005-06-30T17:30:00"
public static java.lang.String mjdToDate(double mjd)
yyyy-mm-dd
.mjd
- modified Julian datemjd
mjdToDate(53551.72917) = "2005-06-30"
public static java.lang.String mjdToTime(double mjd)
hh:mm:ss
.mjd
- modified Julian datemjd
mjdToTime(53551.72917) = "17:30:00"
public static double mjdToDecYear(double mjd)
mjd
- modified Julian DatemjdToDecYear(0.0) = 1858.87671
public static java.lang.String formatMjd(double mjd, java.lang.String format)
java.text.SimpleDateFormat
class.
The default output corresponds to the string
"yyyy-MM-dd'T'HH:mm:ss
"mjd
- modified Julian dateformat
- formatting pattternmjd
SimpleDateFormat
formatMjd(50000.3, "EEE dd, MMM, yy")
= "Tue 10 Oct, 95"
, formatMjd(50000.1234, "'time 'H:mm:ss.SSS")
= "time 2:57:41.760"
public static double mjdToJulian(double mjd)
mjd
- modified Julian datemjdToJulian(0.0) = 1858.87885
public static double julianToMjd(double julianEpoch)
julianEpoch
- Julian epochjulianToMjd(2000.0) = 51544.5
public static double mjdToBesselian(double mjd)
mjd
- modified Julian datemjdToBesselian(0.0) = 1858.87711
public static double besselianToMjd(double besselianEpoch)
besselianEpoch
- Besselian epochbesselianToMjd(1950.0) = 33281.92346
public static double unixMillisToMjd(long unixMillis)
unixMillis
- milliseconds since the Unix epochpublic static long mjdToUnixMillis(double mjd)
mjd
- modified Julian dateCopyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.