Function zulutosec

  • GeneralizedTime or UTCTime string to seconds from Unix origin

    Parameters

    • s: string

      GeneralizedTime or UTCTime string (ex. 20170412235959.384Z)

    Returns number

    seconds from Unix origin time (i.e. Jan 1, 1970 0:00:00 UTC)

    Description

    This function converts from GeneralizedTime string (i.e. YYYYMMDDHHmmSSZ) or UTCTime string (i.e. YYMMDDHHmmSSZ) to seconds from Unix origin time (i.e. Jan 1 1970 0:00:00 UTC). Argument string may have fraction of seconds however result value will be omitted. 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

    zulutosec(  "071231235959Z")       -> 1199145599 #Mon, 31 Dec 2007 23:59:59 GMT
    zulutosec( "071231235959.1Z") -> 1199145599 #Mon, 31 Dec 2007 23:59:59 GMT
    zulutosec("20071231235959Z") -> 1199145599 #Mon, 31 Dec 2007 23:59:59 GMT