CalcJD


The CalcJD function calculates the Julian Date from date and time components (year, month, day, hour, minute, and seconds). Date and time are specified in Universal Time ("UT", also known as GMT). To get the Heliocentric Julian Date, use CalcHJD.

Syntax

nJD = CalcJD( sDate, sTime )

where

    sDate, sTime are the UT date and time strings to convert to Julian Date.

    nJD is the Julian Date (e.g., 2441552.645325).

  

To split the Julian Date into its date and time components, use ParseJD. To split the Julian Date into date and time strings, use JDtoDateTime.

Example

The following script converts UT date and time, given as strings, to the Julian Date:

sDate = "2007, 4, 23"

-- 23 April 2007 UT

sTime = "2 15 30.5"

-- 02:15:30.5 UT

nJD = CalcJD( sDate, sTime )

-- calculate the Julian Date

Printf("JD = %14.6lf\r\n", nJD )

-- Result: JD = 2454213.594103

Related Topics

FormatYmdStr

JDtoDateTime

CalcMJD

ParseJD

CalcHJD