There are many endpoints that enable you to filter on a date, such as the date that a record was inserted or updated. In these cases, you can filter based on a range of values.
Date formats
The most simple filter is to specify a date and check for equality. When doing so, use the RFC3339 format. For example:
2018-12-25
1985-04-12T23:20:50.52Z
1996-12-19T16:39:57-08:00
2018-12-25
This is a flexible, unambiguous format that allows you to specify a date, date/time, and time zones.
Basic date operations
Typically, you don’t want to filter on an exact date, but rather to specify an operation. To do this, put one of the following operations before the date: =
, >
, <
, >=
, <=
>2013-01-24
<=2019-12-31T23:59:59Z
Date ranges
You can also filter based on date ranges. To do this, insert two dates between brackets, separated by a comma. You can use square brackets []
for inclusive ranges and round brackets ()
for exclusive ranges. You can also mix and match brackets.
[2013-03-04,2013-03-04T23:20:50.52Z]
[2018-01-01,2019-01-01) // anything in 2018
Date filters must be encoded
Most date filters are supplied in the query string, meaning they have to be encoded just like any other query-string parameter. Most dates will work regardless of encoding, but it is considered a best practice to always encode.