ToTime

Copied!
( 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

value

Any

The value to attempt to convert to a Timestamp.

Returns

A Timestamp created by interpreting value.

Examples

The following query converts the string "2015-02-20T06:30:00Z" to a timestamp:

Copied!
('2020-07-06T12:34:56.789Z')
("2020-07-06T12:34:56.789Z")
Query metrics:
  •    bytesIn:  38

  •   bytesOut:  47

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 2ms

  •    retries:   0

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!