MGH_DT_JULDAY
Name
MGH_DT_JULDAY
Purpose
Given date & time expressed in calendar form (year, month, day,
hour, minute, second, time zone), this function returns the Julian
date
Calling Sequence
Result = MGH_DT_JULDAY(YEAR=year, MONTH=month, DAY=day, HOUR=hour,
MINUTE=minute, SECOND=second, ZONE=zone)
Result = MGH_DT_JULDAY(param)
Parameters
The function accepts values for year, month, day, hour, minute,
second and time zone. These can be passed as keyword parameters
or combined into a single positional parameter in one of two forms:
* As tags in a single structure
* As fields in a string in ISO format
Return Value
The function returns a double-precision floating point number.
Explanation
I just don't like JULDAY. The order of arguments is wrong and
JULDAY(1,1,2000) doesn't equal JULDAY(1,1,2000,0,0,0). This
function replaces JULDAY and addresses these objections
Example
print, mgh_dt_julday(YEAR=2000, MONTH=1, DAY=1, $
HOUR=0, MINUTE=0, SECOND=0)
2451544.5
print, mgh_dt_julday(YEAR=2000)
2451544.5
print, mgh_dt_julday('2000-01-01 00:00:00')
2451544.5
###########################################################################
Copyright (c) 2000-2012 NIWA:
http://www.niwa.co.nz/
Licensed under the MIT open source license:
http://www.opensource.org/licenses/mit-license.php
###########################################################################
Modification History
Mark Hadfield, 2000-08:
Written.
Mark Hadfield, 2000-09:
Added ZONE argument.
Mark Hadfield, 2001-05:
New keyword/structure argument passing.
Mark Hadfield, 2001-08:
Updated for IDL 5.5.
Mark Hadfield, 2002-09:
Added support for ISO strings.
Mark Hadfield, 2004-06:
Added support for array positional parameters.
Mark Hadfield, 2004-07:
Fixed a bug introduced with array parameters: when a scalar
positional parameter was passed, the result was a single-element array.