diff --git a/releasenotes/notes/bug-2052593-f683555b24f1fba7.yaml b/releasenotes/notes/bug-2052593-f683555b24f1fba7.yaml new file mode 100644 index 0000000..a54c5ce --- /dev/null +++ b/releasenotes/notes/bug-2052593-f683555b24f1fba7.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + The localtz YAQL function now returns daylight saving time when daylight + saving is actually enabled in the system. Previously it returned daylight + saving time if the system time zone has daylight saving time. diff --git a/yaql/standard_library/date_time.py b/yaql/standard_library/date_time.py index d13f359..0adc657 100644 --- a/yaql/standard_library/date_time.py +++ b/yaql/standard_library/date_time.py @@ -322,7 +322,7 @@ def localtz(): yaql> localtz().hours 3.0 """ - if python_time.daylight: + if python_time.localtime().tm_isdst: return TIMESPAN_TYPE(seconds=-python_time.altzone) else: return TIMESPAN_TYPE(seconds=-python_time.timezone)