リファレンス · <chikyu-earth-realistic> 要素
readTime関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A time attribute: "now" (or none) follows the clock, else an ISO date such as 2026-06-21T12:00:00Z.
インポート
import { readTime } from "@johnmorrisdotca/chikyu-earth/realistic/element";
定義
function readTime(value: string | null): number | "now"
引数
| 名前 | 型 | 説明 |
|---|---|---|
value | string | null | The attribute's text, or |
戻り値
number | "now"
The moment in milliseconds since the Unix epoch, or "now" when the value is empty, "now" or not a date.
例
import { readTime } from "@johnmorrisdotca/chikyu-earth/realistic/element";
console.log(readTime("2026-06-21T12:00:00Z"), readTime(null), readTime("tomorrow"));この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。