(core) Account for timezone in TODAY()

Summary: return NOW(tz=tz).date()

Test Plan: None, curious to see if this fixes test_time_defaults when run near midnight.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3079
This commit is contained in:
Alex Hall 2021-10-19 21:36:14 +02:00
parent e900f39da3
commit 1ed4ca61ea

View File

@ -467,11 +467,11 @@ def SECOND(time):
return _make_datetime(time).second return _make_datetime(time).second
def TODAY(): def TODAY(tz=None):
""" """
Returns the `date` object for the current date. Returns the `date` object for the current date.
""" """
return datetime.date.today() return NOW(tz=tz).date()
_weekday_type_map = { _weekday_type_map = {