formatTime#
Compatibility alias of formatDateTime: render an instant in a named time format.
Available in: math cells, REPL.
Syntax#
formatTime(value, format [, timezone])
Arguments and behavior#
Formats: iso (2017-01-14T20:09:50.000Z), date (2017-01-14), time (20:09:50), datetime (2017-01-14 20:09:50), weekday (Saturday), rfc (Sat, 14 Jan 2017 20:09:50 GMT), human (Sat Jan 14 2017 20:09:50 GMT+0000). The value is an instant and carries no timezone of its own, so the timezone argument decides how it is rendered; it defaults to UTC, and "local" or an offset such as "+05:30" are also accepted. The example returns scalar (string).
Example#
Edit the inputs, then use Run or Reset. Changes stay in this example.
formatTime(toEpoch("2017-01-14 20:09:50"), "iso")Interactive examples could not load. You can still copy the expressions.
Expected result: "2017-01-14T20:09:50.000Z".
See also#
toEpoch · parseDateTime · formatDateTime · startOf · endOf