Time()
Description
The Time()
method converts an ISO-8601 timeString to a
Time value.
Parameter fields:
Time field | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
|
Four-digit year. |
||||||||
|
Month, from |
||||||||
|
Day, from |
||||||||
|
Date and time separator. |
||||||||
|
Hours, from |
||||||||
|
Minutes, from |
||||||||
|
Seconds, from |
||||||||
|
Timezone offset from UTC which can be one of:
|
This method is equivalent to the Time.fromString()
method.
Examples
"2022-10-20T21:15:09.890729Z"
Test if a document timestamp is equal to a given time:
{
data: [
{
id: "353770634073866274",
coll: Customer,
ts: Time("2023-01-13T20:13:37.670Z"),
name: "Ignatious J. Reilly",
address: {
street: "811 Canal Street.",
city: "New Orleans",
state: "LA",
country: "USA",
zip: 70112
}
}
]
}
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!