Time
|
This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics. |
Time( str )
Time( str )
Time( str )
Time( str )
Time( str )
Time( str )
Description
The Time function constructs a Timestamp, either from the
string now, or from an ISO 8601 string.
The special string now may be used to construct a time from the
transaction’s start time. Multiple references to now within the same
transaction produce the same timestamp. During a temporal query, now still
means the transaction’s start time, not the temporal query’s specified
timestamp.
Use of now is deprecated. Use Now instead.
|
ISO 8601 times
Time uses Java’s Date/Time API which understands a subset of the
ISO 8601 standard. Not all time strings that are ISO 8601-compliant can
be parsed.
The template for times is yyyy-MM-ddThh:mm:ssTZO, where:
-
yyyyrepresents the year -
MMrepresents the month, from00to12 -
ddrepresents the day, from00to31 -
Tis a separator between the date and time -
hhrepresents the hours, from00to23 -
mmrepresents the minutes, from00to59 -
ssrepresents the seconds, from00to59 -
TZOis the timezone offset from GMT, which can be:-
Zfor GMT (no offset) -
+hhmmfor a positive hour and minute offset from GMT -
-hhmmfor a negative hour and minute offset from GMT
-
The seconds can also be expressed as a decimal fraction, which provides down to nanosecond resolution.
Parameters
| Parameter | Type | Definition and Requirements |
|---|---|---|
|
String |
The String |
Examples
The following query returns a Timestamp constructed from the provided string:
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")