Check out v4 of the Fauna CLI

v4 of the Fauna CLI is now in beta.

The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start.

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")

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!