From 1ed4ca61ea47dfa0ec7e7de9e88d1ee6608ed281 Mon Sep 17 00:00:00 2001 From: Alex Hall Date: Tue, 19 Oct 2021 21:36:14 +0200 Subject: [PATCH] (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 --- sandbox/grist/functions/date.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sandbox/grist/functions/date.py b/sandbox/grist/functions/date.py index a2ba2692..10f953c1 100644 --- a/sandbox/grist/functions/date.py +++ b/sandbox/grist/functions/date.py @@ -467,11 +467,11 @@ def SECOND(time): return _make_datetime(time).second -def TODAY(): +def TODAY(tz=None): """ Returns the `date` object for the current date. """ - return datetime.date.today() + return NOW(tz=tz).date() _weekday_type_map = {