Function: time.format

Formats the given timestamp as a human-readable string.

Arguments

Arguments
seconds

integer|float

A timestamp in seconds since epoch.

timezone

string

A timezone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. If not specified or if an empty string, the default is UTC.

Returns

A timestamp string in ISO 8601 format, up to a microsecond precision. For example: "2024-01-10T16:15:54.615087Z".

Examples

# Format given timestamp as human-readable string
# For example, returns "2024-07-12T12:50:33.000000Z"
- returnStep:
    return: ${time.format(1720788633,"GMT")}
# Or, you can use `sys.now` which returns Unix time
- returnStep:
    return: ${time.format(sys.now())}