8000 Dates with times and timezones are now supported on Database Date Filters · Issue #182 · notion-dotnet/notion-sdk-net · GitHub
[go: up one dir, main page]

Skip to content
Dates with times and timezones are now supported on Database Date Filters #182
Closed
@KoditkarVedant

Description

@KoditkarVedant

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestverificationCheck if bug/feature needs to be implemented

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0