Time.epoch()

Convert a Unix epoch timestamp to a Time.

Signature

Time.epoch(offset: Number, unit: String) => Time

Description

Converts a Number representing a Unix epoch timestamp to a Time value.

Parameters

Parameter Type Required Description

offset

Number

true

Offset from the Unix epoch.

unit

String

true

Time unit used to measure the offset from the Unix epoch.

nanoseconds
microseconds
milliseconds
seconds
minutes
hours
days

Return value

Type Description

Time

Resulting Time, rounded to the nearest nanosecond.

Examples

Time.epoch(1676030400, 'seconds')
Time("2023-02-10T12:00:00Z")
\