FormatISO8601DateTime (open)
Formats a datetime in the ISO 8601 format
Syntax
LOADLIB "wh::datetime.whlib";
STRING FUNCTION FormatISO8601DateTime(DATETIME whattime, RECORD options)Parameters
DATETIME whattimeTime to format, in UTC
RECORD optionsOptions (this function can also be invoked with dateformat, timeformat, timezone and extended as separate parameters, but this syntax is deprecated)
STRING dateformatDate precision: "year", "month", "day", "week", "weekday", "yearday", "empty". If unset, defaults to "day"
BOOLEAN extendedUse extended format, e.g. "2001-01-01T12:34:56+01:00" instead of "20010101T123456+0100", defaults to TRUE
STRING timeformatTime precision: "hours", "minutes", "seconds", "milliseconds", "empty". If unset, defaults to "seconds"
STRING timezone(optional) timezone to present the time in. If unset, defaults to "UTC"
Return value
STRINGThe formatted time
Description
This function will format a datetime according to ISO 8601, as described in http://www.w3.org/TR/NOTE-datetime