CalcJD


The CalcJD function calculates the Julian Date from the UT date and time. The date and time may be expressed as two strings for date and time or as a merged ISO 8601 date/time string. This function calculates the geocentric which is independent of Earth's motion and the object coordinates. Use CalcHJD to calculate the Heliocentric Julian Date which removes these small effects to correct to the position of the Sun.

Syntax

nJD = CalcJD( sDate, sTime )

nJD = CalcJD( sDateTime )

bullet.gif    sDate, sTime are UT date and time strings that will be converted to Julian Date.

bullet.gif    sDateTime is the standard (ISO 8601) merged UT date/time string separated with the letter T, like '2024-12-23T04:17:49'.

bullet.gif    nJD is returned as the Julian Date (e.g., 2441552.645325).

Remarks

The following inverse operations convert a Julian Date number to its number and string components:

bullet.gif    Use ParseJD to split the Julian Date number into 3 numbers for the date and 3 numbers for the time.

bullet.gif    Use JDtoDateTime to split the Julian Date number into two strings for date and time.

Example

The following script calculates the Geocentric Julian Date from UT date and time strings:

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

The following script calculates the Julian Date using the ISO 8601 version of date and time:

sDateTime = "2007-04-23T02:15:30.5"

-- ISO 8601 version of date & time

nJD = CalcJD( sDateTime )

-- calculate the Julian Date

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

-- Result: JD = 2454213.594103

Related Topics

Date and Time Functions

FormatYmdStr

JDtoDateTime

CalcMJD

CalcHJD

ParseJD

 


Mira Pro x64 Script User's Guide, v.8.77 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.