ModulesTime
Time/UnixTime.ts
UnixTime overview
Unix time in milliseconds since epoch (January 1, 1970 00:00:00 UTC). Used for JavaScript Date interop and general time operations.
Added in v2.0.0
Table of contents
Time
UnixTime (type alias)
Unix time in milliseconds since epoch (January 1, 1970 00:00:00 UTC). Used for JavaScript Date interop and general time operations.
Signature
export type UnixTime = bigintAdded in v2.0.0
fromDate
Convert JavaScript Date to UnixTime.
Signature
export declare const fromDate: (date: Date) => UnixTimeAdded in v2.0.0
fromSeconds
Convert seconds to UnixTime (milliseconds).
Signature
export declare const fromSeconds: (seconds: bigint) => UnixTimeAdded in v2.0.0
now
Get current UnixTime.
Signature
export declare const now: () => UnixTimeAdded in v2.0.0
toDate
Convert UnixTime to JavaScript Date.
Signature
export declare const toDate: (unixTime: UnixTime) => DateAdded in v2.0.0
toSeconds
Convert UnixTime (milliseconds) to seconds.
Signature
export declare const toSeconds: (unixTime: UnixTime) => bigintAdded in v2.0.0