>  Docs Center  >  Libraries  >  Motley  >  MGH_DT_JULDAY
Libraries

MGH_DT_JULDAY

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
###########################################################################
  This software is provided subject to the following conditions:
  1. NIWA makes no representations or warranties regarding the
    accuracy of the software, the use to which the software may
    be put or the results to be obtained from the use of the
    software. Accordingly NIWA accepts no liability for any loss
    or damage (whether direct of indirect) incurred by any person
    through the use of or reliance on the software.
  2. NIWA is to be acknowledged as the original author of the
    software where the software is used or presented in any form.
###########################################################################

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.



© 2024 NV5 Geospatial Solutions, Inc. |  Legal
   Contact Us