datetime2num
The datetime2num function returns the Julian Date from a string like '2005-09-28T04:35:14.45' or 2005-09-28T04:35:14.45. Strings with enclosing ' ' are present in FITS image headers and are returned using CImage:KwdGetRaw.
NOTE: |
You may wish to test if the string is a time value before calling this function to avoid the ambiguous results for datetime2num("0000-00-00T00:00:00") and datetime2num(0). |
nJD = datetime2num( sString ) |
sString is
the target string.
nJD is the
Julian Date.
On
failure, 0.0 is returned.
The scripts below return the Julian Date for several strings:
|
-- date+time string with ' ' |
|
|
|
|
|
-- prints JD = 2453641.69113947 |
|
|
|
|
|
-- date+time string without ' ' |
|
|
|
|
|
-- prints JD = 2453641.69113947 |
|
|
|
|
|
-- prints t = 0 |
|
-- prints t = 0 |
Mira Pro x64 Script User's Guide, v.8.77 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.