function
DateTime
Convert a time to the text a date-and-time field stores.
Example
query.GreaterThan("publishedAt", query.DateTime(time.Now()))Arguments
| Argument | Type | Description |
|---|---|---|
t | time.Time | The moment to compare with. It is converted to UTC with milliseconds. |
Returns
A string value such as 2026-09-29T14:05:00.000Z.
ValueHow it works
Use it for date-and-time fields, createdAt, and updatedAt. Compare a date-only field with a "2006-01-02" string instead.
Full signature
Related types
ValueAn immutable scalar or list comparison operand.