A wrapper aroud the Fauna Date type. It represents a calendar date that is
not associated with a particular time or time zone, e.g. August 24th, 2006.
Convert to and from Javascript Date's with the DateStub.fromDate and
DateStub.toDate methods. Javascript Dates are rendered in UTC time
before the date part is used.
See remarks for possible precision loss when doing this. If precision loss is
a concern consider using a 3rd party datetime library such as luxon.
Remarks
The Javascript Date type always has a time associated with it, but
Fauna's Date type does not. When converting from a Fauna Date to a
Javascript Date, we set time to 00:00:00 UTC. When converting a Javascript
Date or time string to Fauna Date, we convert to UTC first. Care should
be taken to specify the desired date, since Javascript Dates use local
timezone info by default.
A wrapper aroud the Fauna
Date
type. It represents a calendar date that is not associated with a particular time or time zone, e.g. August 24th, 2006. Convert to and from Javascript Date's with the DateStub.fromDate and DateStub.toDate methods. Javascript Dates are rendered in UTC time before the date part is used. See remarks for possible precision loss when doing this. If precision loss is a concern consider using a 3rd party datetime library such as luxon.Remarks
The Javascript
Date
type always has a time associated with it, but Fauna'sDate
type does not. When converting from a FaunaDate
to a JavascriptDate
, we set time to 00:00:00 UTC. When converting a JavascriptDate
or time string to FaunaDate
, we convert to UTC first. Care should be taken to specify the desired date, since JavascriptDate
s use local timezone info by default.See
https://docs.fauna.com/fauna/current/reference/fql_reference/types#date