Date
Date( str )
Date( str )
Date( str )
Date( str )
date( str )
Date( str )
Description
The Date
function constructs a Date from an ISO 8601
formatted date string.
Date only accepts a date string. An error occurs if you
include any time information.
|
ISO 8601 dates
Date
uses Java’s Date/Time API which understands a subset of the
ISO 8601 standard. Not all date strings that are ISO 8601-compliant can
be parsed.
The template for dates is yyyy-MM-dd
, where:
-
yyyy
represents the year -
MM
represents the month, from00
to12
-
dd
represents the day, from00
to31
Returns
A Date type which represents the converted string.
Examples
The following query returns a Date constructed from the provided string:
FaunaDate(1970-01-01 12:00:00 AM)
{0 62135596800 <nil>}
1970-01-01
Date("1970-01-01")
1970-01-01
Date("1970-01-01")
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!