-
Notifications
You must be signed in to change notification settings - Fork 113
Notion 'YYYY-MM-DD' Dates are saved as 'YYYY-MM-DDTHH:MM:SSZ' DateTimes #26
Description
Hello again! These two bugs are related and I saw them after this issue was solved:
Bug 1
When I try to update a date with:
anyquery -q "UPDATE notion_database SET \`Review Date\` = '2024-12-17' WHERE _page_id = '15776305-7c51-80db-ada0-f8cb0daa92cb';"or with:
anyquery -q "UPDATE notion_database SET \`Review Date\` = '17/12/2024' WHERE _page_id = '15776305-7c51-80db-ada0-f8cb0daa92cb';"Then, on the Notion UI I see that the "Include Time" flag set to true, and the time is 00:00:00 in the UTC timezone.
The expected result is that the new value for Review Date should be just a date with no time specified ("Include Time" set to false).
(PS: When I update a date with either YYY-MM-DDTHH:MM:SSZ or with YYYY-MM-DDTHH:MM:SSZ/YYYY-MM-DDTHH:MM:SSZ (with Z being any offset) the date time is saved correctly).
Bug 2
Moreover, let's say that in my table I have more fields that are also date fields, and each of these fields contain a date (or two dates with or without time) So, if I want to modify the Title field of the row, and I run this:
anyquery -q "UPDATE notion_database SET \`Title\` = 'New Name' WHERE \`_page_id\` = '15776305-7c51-80db-ada0-f8cb0daa92cb';"Then, all date fields are ALSO modified like this:
- If the field had the "Include Time" flag set to false, it is now set to true and, the time is
00:00:00in the UTC timezone. - If the field had the "Include Time" flag set to true and the time zone was
Z, then the field stays as is. - If the field had the "Include Time" flag set to true and the time zone was not
Z, then the field is still shown with the correct offset, but the time zone id is gone (from the UI).
The expected result is that any field that I'm not explicitly modifying in the UPDATE command should stay as it is.