toEpoch#
Compatibility alias of parseDateTime: parse a date-like value into epoch milliseconds.
Available in: math cells, REPL.
Syntax#
toEpoch(value [, timezone])
Arguments and behavior#
Compatibility alias of parseDateTime: same parsing, same result. Accepts epoch seconds or milliseconds (ten digits or fewer is seconds; durations such as 1 ms and engine values such as BigNumbers are already milliseconds and are kept as-is), ISO 8601 strings, plain dates (2017-01-14, 02/25/2017, 25.02.2017), clock times (08:00, 09:30 PM), and relative words (now, today, tomorrow, yesterday, last Monday). The timezone argument defaults to UTC so results stay reproducible; pass "local" for the device zone or an offset such as "+05:30". A timezone written in the text wins over the argument, and an explicit offset in an ISO string wins over both. The result is a plain number of milliseconds, so it renders in the session's number format; use formatDateTime (or its alias formatTime) for a readable rendering. The example returns scalar (number).
Example#
Edit the inputs, then use Run or Reset. Changes stay in this example.
toEpoch("2017-01-14")Interactive examples could not load. You can still copy the expressions.
Expected result: 1.484352e+12.