DMJD to UT

Share:

Description

Decimal modified Julian date to Universal time.

Usage

1
dmjd2ut(dmjd, tz='UTC')

Arguments

dmjd

Time in decimal Modified Julian Date

tz

Time zone string

Details

Calculation is always from UTC, but it is possible to correct to local time zone with tz (see Sys.timezone). For instance, tz = 'EST5EDT' converts to U.S. Eastern time, with EST or EDT based on the system's knowledge of the date for switching between the two. Set the number of digits after the decimal place for seconds, n, with options('digits.secs'=n).

Value

Time string with class POSIXct

Author(s)

Andrew Harris

See Also

ut2dmjd, ymd2jd, strptime, ISOdatetime, axis.POSIXct for time in plot axes; as.POSIXct to recover time in plot from locator()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
dmjd2ut(56951.54183613)

sd <- getOption('digits.secs')
dmjd2ut(ut2dmjd(2010, 1, 5, 2, 34, 17.8115))
options('digits.secs' = 3)
dmjd2ut(ut2dmjd(2015, 1, 5, 2, 34, 17.8115))
options('digits.secs' = sd)

dmjd2ut(ut2dmjd(2015, 1, 5, 2, 34, 17.8115), tz='CET')
dmjd2ut(ut2dmjd(2015, 8, 5, 2, 34, 17.8115), tz='CET')
dmjd2ut(ut2dmjd(2015, 1, 5, 2, 34, 17.8115), tz='EST5EDT')
dmjd2ut(ut2dmjd(2015, 8, 5, 2, 34, 17.8115), tz='EST5EDT')

dmjd2ut(ymd2jd(2001, 1, 1) - 2400000.5)