FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date. For more details, review the migration guide. Contact support@fauna.com with any questions. |
ToTime
This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics. |
ToTime( value )
to_time( value )
ToTime( value )
ToTime( value )
ToTime( value )
Description
The ToTime
function converts a value to a timestamp, if
possible.
Attempting to convert a value to a timestamp which has no timestamp representation results in an "invalid argument" error.
Parameters
Parameter | Type | Definition and Requirements |
---|---|---|
|
Any |
The value to attempt to convert to a Timestamp. |
Examples
The following query converts the string "2015-02-20T06:30:00Z" to a timestamp:
Time("2020-07-06T12:34:56.789Z")
FaunaTime('2015-02-20T06:30:00Z')
{0 63560010600 <nil>}
FaunaTime(2015-02-20T06:30:00Z)
Time("2020-07-06T12:34:56.789Z")
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!