Description
Previously, the date filters equals, after, before, on_or_after, and on_or_before only supported dates without times nor timezones.
{
"filter": {
"or": [
{
"property": "My Time Property",
"date": {
"before": "2021-10-20"
}
}
]
},
"sorts": []
}
Now the database date filters can accept ISO 8601 dates with timestamps and timezones.
{
"filter": {
"or": [
{
"property": "My Time Property",
"date": {
"before": "2021-10-15T12:00:00-07:00"
}
}
]
},
"sorts": []
}
How Dates with times are compared
Date time comparisons are done with millisecond precision. If no timezone is provided, the default is UTC.
Equals Date Filter
If a date without a time is provided to the equals, the comparison is done against the start and end of the UTC date provided (inclusive). If a date with a time is provided, the comparison is done with millisecond precision. If no timezone is provided, the default timezone is UTC.
Notion API changelog: https://developers.notion.com/changelog/dates-with-times-and-timezones-are-now-supported-on-database-date-filters