Function zulutodate

  • GeneralizedTime or UTCTime string to Date object

    Parameters

    • s: string

      GeneralizedTime or UTCTime string (ex. 20170412235959.384Z)

    Returns Date

    Date object for specified time

    Description

    This function converts from GeneralizedTime string (i.e. YYYYMMDDHHmmSSZ) or UTCTime string (i.e. YYMMDDHHmmSSZ) to Date object. Argument string may have fraction of seconds and its length is one or more digits such as "20170410235959.1234567Z". As for UTCTime, if year "YY" is equal or less than 49 then it is 20YY. If year "YY" is equal or greater than 50 then it is 19YY.

    Example

    zulutodate(  "071231235959Z").toUTCString()   -> "Mon, 31 Dec 2007 23:59:59 GMT"
    zulutodate( "071231235959.1Z").toUTCString() -> "Mon, 31 Dec 2007 23:59:59 GMT"
    zulutodate("20071231235959Z").toUTCString() -> "Mon, 31 Dec 2007 23:59:59 GMT"
    zulutodate( "071231235959.34Z").getMilliseconds() -> 340