std/zone
std/zone
导入自 @norbital-ai/std/zone
std/zone: wall-clock ⇄ UTC in an IANA zone through Intl (std/date and std/calendar build on it). Milliseconds in a UTC day.
DAY_MS const
const DAY_MS: 86400000 Milliseconds in a UTC day.
源码: packages/std/src/zone.ts:3
localOf function
function localOf(ms: number, zone: string): { date: string; msOfDay: number; } The zone-local calendar day and milliseconds into it of a UTC instant.
参数
| 名称 | 类型 | 说明 |
|---|---|---|
ms | number | |
zone | string |
源码: packages/std/src/zone.ts:25
utcOf function
function utcOf(date: string, msOfDay: number, zone: string): number The UTC instant (ms) of a zone-local wall time, as Temporal's 'compatible': in a fold the earlier instant, in a gap the wall time read with the offset before the gap (so it lands after it).
参数
| 名称 | 类型 | 说明 |
|---|---|---|
date | string | |
msOfDay | number | |
zone | string |