Dates & Times
All dates and times conform to the ISO 8601 standard and look like this:
| Value | Format | Example |
|---|---|---|
| date | YYYY-MM-DD | 2015-05-05 |
| date and time | YYYY-MM-DDTHH:MM:SSZ | 2015-05-05T22:40:07Z |
Responses
Times are always returned in UTC.
Querying
Operators
When querying for date_time attributes, multiple operators are available. If you want to query Plans on created_at for example:
| Operator | Usage | Result |
|---|---|---|
= |
?where[created_at]=2018-02-22 |
created on February 22nd, 2018 |
[gt]= |
?where[created_at][gt]=2018-02-22 |
created after February 22nd, 2018 |
[gte]= |
?where[created_at][gte]=2018-02-22 |
created on or after February 22nd, 2018 |
[lt]= |
?where[created_at][lt]=2018-02-22 |
created before February 22nd, 2018 |
[lte]= |
?where[created_at][lte]=2018-02-22 |
created on or before February 22nd, 2018 |
gt, gte, lt, and lte can be combined to further filter records. For example ?where[created_at][gte]=2018-02-01&where[created_at][lte]=2018-02-28 will return all Plans created during February 2018.
Time-zone-aware dates
When querying for date_time attributes, you can specify a date value or a date and time value. Date values are assumed to be in the Organization's time zone, and the API will automatically convert them to the corresponding moment or span. For example:
| Usage | Time zone | Result |
|---|---|---|
?where[created_at]=2018-02-22 |
Pacific Time (US & Canada) | 2018-02-22T08:00:00Z <= created_at <= 2018-02-23T07:59:59.999999Z |
?where[created_at][gt]=2018-02-22 |
Pacific Time (US & Canada) | created_at > 2018-02-23T07:59:59.999999Z |
?where[created_at][gte]=2018-02-22 |
Pacific Time (US & Canada) | created_at >= 2018-02-22T08:00:00Z |
?where[created_at][lt]=2018-02-22 |
Pacific Time (US & Canada) | created_at < 2018-02-22T08:00:00Z |
?where[created_at][lte]=2018-02-22 |
Pacific Time (US & Canada) | created_at <= 2018-02-23T07:59:59.999999Z |
You can opt out of this behavior by specifying date and time values. For example:
| Usage | Result |
|---|---|
?where[created_at]=2018-02-22T00:00:00Z |
created on February 22nd, 2018 at 00:00:00 in UTC |
?where[created_at][gte]=2018-02-22T00:00:00-05:00 |
created on February 22nd, 2018 in EST |