The Fauna service will be ending on May 30, 2025.

For more information on the service wind down, see our announcement and the Fauna Service End-of-Life FAQ.

Date()

Construct a Date from a ISO 8601 date String.

Signature

Date(date: String) => Date

Description

The Date() method converts a YYYY-MM-DD String to a Date.

The method accepts only a date String and returns an error if time information is included in the String.

Date objects render to date strings in query responses.

This method is equivalent to Date.fromString().

Parameters

Parameter Type Required Description

date

String

true

Date String in the YYYY-MM-DD format.

Return value

Type Description

Date

Date representation of the string.

Examples

Convert a date string to a Date:

Date("2099-10-20")
Date("2099-10-20")
\