Reference · The <chikyu-earth-realistic> element
readTimefunction
A time attribute: "now" (or none) follows the clock, else an ISO date such as 2026-06-21T12:00:00Z.
Import it
import { readTime } from "@johnmorrisdotca/chikyu-earth/realistic/element";
Definition
function readTime(value: string | null): number | "now"
Parameters
| Name | Type | Description |
|---|---|---|
value | string | null | The attribute's text, or |
Returns
number | "now"
The moment in milliseconds since the Unix epoch, or "now" when the value is empty, "now" or not a date.
Examples
import { readTime } from "@johnmorrisdotca/chikyu-earth/realistic/element";
console.log(readTime("2026-06-21T12:00:00Z"), readTime(null), readTime("tomorrow"));