ToDate

Copied!
( value )

Description

The ToDate function converts a value to a date type, if possible.

Attempting to convert a value to a date which has no date representation results in an "invalid argument" error.

Parameters

Parameter Type Definition and Requirements

value

Any

The value to attempt to convert to a Date.

Returns

A Date created by converting from value.

Examples

The following query converts the string "2018-06-06" to a date:

Copied!
('2018-06-06')
("2018-06-06")
Query metrics:
  •    bytesIn:  24

  •   bytesOut:  35

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 4ms

  •    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!