Wilang Documentation1.0.0+4

parseDateTime#

Parse a date-like value into epoch milliseconds.

Available in: math cells, REPL.

Syntax#

parseDateTime(value [, timezone])

Arguments and behavior#

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 for a readable rendering. toEpoch is a compatibility alias with identical behavior. The example returns scalar (number).

Example#

Edit the inputs, then use Run or Reset. Changes stay in this example.

Example
parseDateTime("2017-01-14")

Expected result: 1.484352e+12.

See also#

toEpoch · now · formatDateTime · startOf

All functions · Math guides