Skip to content

Date & heure ​

now() renvoie l'horodatage ISO 8601 courant, millis() les millisecondes epoch ; fromMillis/toMillis convertissent entre les deux représentations.

now ​

now(): string

Horodatage courant, ISO 8601.

typeflow
processedAt: now()

millis ​

millis(): number

Horodatage courant, en millisecondes depuis l'epoch.

typeflow
processedAtMs: millis()

fromMillis ​

fromMillis(millis: number): string

Millisecondes epoch → chaîne ISO 8601.

typeflow
created: fromMillis(event.createdAt)

toMillis ​

toMillis(timestamp: string): number

Chaîne ISO 8601 (ou toute date analysable) → millisecondes epoch.

typeflow
createdAtMs: toMillis(event.createdAt)

Playground ​

Mapping✔Playground ↗
JSON d'entrée
Sortie
{
  "created": "2025-07-02T00:00:00.000Z",
  "roundTrip": 1751414400000,
  "epoch": "1970-01-01T00:00:00.000Z"
}
type inféré{ created: string; roundTrip: number; epoch: string }

Publié sous licence MIT.