Skip to content

Date & time ​

now() returns the current ISO 8601 timestamp, millis() the epoch milliseconds; fromMillis/toMillis convert between the two representations.

now ​

now(): string

Current timestamp, ISO 8601.

typeflow
processedAt: now()

millis ​

millis(): number

Current timestamp, milliseconds since the epoch.

typeflow
processedAtMs: millis()

fromMillis ​

fromMillis(millis: number): string

Epoch milliseconds → ISO 8601 string.

typeflow
created: fromMillis(event.createdAt)

toMillis ​

toMillis(timestamp: string): number

ISO 8601 (or any parseable date) string → epoch milliseconds.

typeflow
createdAtMs: toMillis(event.createdAt)

Playground ​

Mapping✔Playground ↗
Input JSON
Output
{
  "created": "2025-07-02T00:00:00.000Z",
  "roundTrip": 1751414400000,
  "epoch": "1970-01-01T00:00:00.000Z"
}
inferred type{ created: string; roundTrip: number; epoch: string }

Released under the MIT License.