Evolution SDK

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 = bigint

Added in v2.0.0

fromDate

Convert JavaScript Date to UnixTime.

Signature

export declare const fromDate: (date: Date) => UnixTime

Added in v2.0.0

fromSeconds

Convert seconds to UnixTime (milliseconds).

Signature

export declare const fromSeconds: (seconds: bigint) => UnixTime

Added in v2.0.0

now

Get current UnixTime.

Signature

export declare const now: () => UnixTime

Added in v2.0.0

toDate

Convert UnixTime to JavaScript Date.

Signature

export declare const toDate: (unixTime: UnixTime) => Date

Added in v2.0.0

toSeconds

Convert UnixTime (milliseconds) to seconds.

Signature

export declare const toSeconds: (unixTime: UnixTime) => bigint

Added in v2.0.0