MJD2unix

From DavinciWiki
Jump to: navigation, search

Description

Convert UTC Modified Julian Date to Unix time

Arguments and Return Values

Parameters: Numeric array specifying the UTC Modified Julian Dates to convert to Unix times

Return Value: The corresponding set of Unix times (in seconds)

Usage

Syntax: MJD2unix(MJD)

The Modified Julian Date is the number of days since midnight UTC at the beginning of November 17, 1858 (in the Gregorian calendar).

Unix time is the number of seconds since midnight UTC at the beginning of January 1, 1970.

Note that since neither of those time scales directly accounts for the addition of leap seconds, they are not truly continuous.

The returned values are as accurate as the input. It is advisable to enter inputs in double format to ensure accuracy; see intermediate float bug.

When MJD2unix() is entered without any arguments, it prints its description, as shown below.

Examples

dv> MJD2unix()

Converts input UTC Modified Julian Date to Unix time
Modified Julian Date is the number of days since midnight
 UTC on November 17, 1858 (in the Gregorian calendar).
Unix time is the number of seconds since midnight UTC on
 January 1, 1970. Returns seconds, not milliseconds.
 Note that Unix time does not account for leap seconds.
It is advisable to enter inputs in double format to ensure accuracy.
 See the DavinciWiki article on the intermediate float bug.
S.Marshall 04-11-2009

0
dv> a = MJD(1970, 1, 1, 0, 0, 0)
40587.0000000000
dv> MJD2unix(a)
0.000000000000000
dv> a = MJD(2010, 1, 1, 12, 0, 0)
55197.5000000000
dv> MJD2unix(a)
1262347200.00000

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Recent Library Changes

Created On: 11-18-2009
Modified On: 05-07-2010

Personal tools