Epoch
This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics. |
Epoch( num, unit )
epoch(0, unit )
Epoch( num, unit )
Epoch( num, unit )
Epoch( num, unit )
Epoch( num, unit )
Description
The Epoch
function constructs a Timestamp relative to the
Unix epoch (1970-01-01T00:00:00Z).
The num
argument must be an integer value. The unit
argument
specifies the scale of num
.
Parameters
Parameter | Type | Definition and Requirements |
---|---|---|
|
Number |
A mathematical integer value specifying the offset from epoch. |
|
String |
Indicates the units used by
|
Examples
The following query adds 0 seconds to the Unix epoch (1970-01-01T00:00:00Z) and returns a timestamp:
Time("1970-01-01T00:00:00Z")
FaunaTime('1970-01-01T00:00:00Z')
{0 62135596800 <nil>}
FaunaTime(1970-01-01T00:00:00Z)
1970-01-01T00:00:00Z
Time("1970-01-01T00:00:00Z")