>  Docs Center  >  Libraries  >  Motley  >  MGH_DT_STRING
Libraries

MGH_DT_STRING

MGH_DT_STRING

Name


  MGH_DT_STRING

Purpose


  Given a date-time in Julian-date (numeric) form return a string
  in ISO 8601 format.

Category


  Date and time.

Calling Sequence


  Result = MGH_DT_STRING(dtval[, zone, /DATE_ONLY])

Positional Parameters


  dtval (input, numeric scalar or array)
    A Julian-date number
  zone (input, integer)
    Time zone relative to UTC, in hours. If this is omitted, then
    the output string's time zone field is omitted. If it is
    supplied, then dtval (which is assumed to be in UTC) is
    converted to the specified zone and a time-zone field is
    included in the output.

Keyword Parameters


  DATE_ONLY (input, switch)
    If DATE_ONLY is set, then the default format generates an ISO
    8601 date (e.g. 2000-08-03) otherwise it generates an ISO 8601
    date-time (e.g. 2000-08-03T11:03:13)

Return Value


  The function returns a string scalar or array. Since formatted
  input is used, arrays are reformed to one dimension and truncated
  at 1024 elements.

To Do


  Allow for fractional time zones. Work around limitations of
  formatted input?
###########################################################################
  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, 2001-05:
    Added the time-zone argument and the handling for it. Removed
    some of the generality in handling formats because this
    conflicts with handling time zones.



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