strftime()

Formats a time to a string. This uses standard POSIX strftime formats.

Format

STRING
strftime(STRING format, TIME time)

Examples

1
2
3
# Concise format
set resp.http.now = strftime({"%Y-%m-%d %H:%M"}, now);
# resp.http.now is now e.g. 2006-01-02 22:04
1
2
3
# RFC 5322 format
set resp.http.start = strftime({"%a, %d %b %Y %T %z"}, time.start);
# resp.http.start is now e.g. Mon, 02 Jan 2006 22:04:05 +0000
1
2
3
# ISO 8601 format
set resp.http.end = strftime({"%Y-%m-%dT%H:%M:%SZ"}, time.end);
# resp.http.end is now e.g. 2006-01-02T22:04:05Z