Date

Date( str )
Date( str )
Date( str )
Date( str )
date( str )
date str
DateFn( str )
Date( str )

Description

The Date function constructs a Date from an ISO 8601 formatted string.

Parameters

Argument Type Definition and Requirements

str

An ISO 8601 date formatted string.

Returns

A Date type which represents the converted string.

Examples

The query below returns a Date constructed from the provided string.

curl https://db.fauna.com/ \
    -u fnAChGwBcAACAO70ziE0cfROosNJHdgBmJU1PgpL: \
    -d '{ "date": "1970-01-01" }'
client.Query(Date("1970-01-01"));
System.out.println( client.query(Date(Value("1970-01-01"))) .get());
result, _ := client.Query(f.Date("1970-01-01"))

fmt.Println(result)
client.query(Date("1970-01-01"))
client.query(q.date("1970-01-01"))
$client.query do
  date '1970-01-01'
end
client.query(DateFn(string: "1970-01-01"))
client.query(q.Date("1970-01-01"))
  .then((ret) => console.log(ret))
HTTP/1.1 200 OK
{ "resource": { "@date": "1970-01-01" } }
{ "@date": "1970-01-01" }
1970-01-01
{0 62135596800 <nil>}
{ "@date": "1970-01-01" }
{ "@date": "1970-01-01" }
{ "@date": "1970-01-01" }
{ "@date": "1970-01-01" }
FaunaDate { value: '1970-01-01' }