Function iso8601tozulu

  • convert ISO8601 time string to GeneralizedTime or UTCTime string

    Parameters

    • s: string

      ISO8601 time string (ex. 2020-07-14T13:03:42Z)

    • flagUTC: boolean = false

      return UTCTime when this flag is true

    Returns string

    GeneralizedTime or UTCTime string (ex. 20170412235959Z or 170412235959Z)

    See

    zulutoiso8601

    Since

    0.10.0

    Example

    iso8601tozulu("2007-12-31T23:59:59Z") -> "20071231235959Z"
    iso8601tozulu( "aaaaaaaaaa") -> raise error
    iso8601tozulu("2007-12-31T23:59:59Z", true) -> "071231235959Z"
    iso8601tozulu("2107-12-31T23:59:59Z", true) -> raise error, year shall be from 1950 to 2049