UnixTimeToIso8601

UnixTimeToIso8601 — converts from Unix time to ISO 8601.

Synopsis

UnixTimeToIso8601 (unixtime)
    

Arguments

unixtime

A floating point number as a UTC UNIX timestamp.

Returns

An ISO 8601 formatted date string.

Description

This function takes a floating point UNIX time and returns an ISO 8601 formatted date string. This string will be in the form YYYY-MM-DDTHH:mm:ss.fffZ where:

YYYY is the 4-digit year.
MM is the 2-digit month, from 1 to 12.
DD is the 2-digit day within the month, from 1 to 31.
T is the literal letter T.
HH is the 2-digit hour within the day, from 0 to 23.
mm is the 2-digit minute within the hour, from 0 to 59.
ss is the 2-digit second within the minute, from 0 to 59.
fff is the 3-digit millisecond within the second, from 0 to 999.
Z is the literal letter Z, indicating UTC time.

This function will always produce a UTC string. The input unixtime must be in UTC.

Example

—> UnixTimeToIso8601(1590237923.6919999123);
"2020-05-23T12:45:23.692Z"