From 4cfdaf8cd1b29fa7a5b5cb82b75875c7d64e5923 Mon Sep 17 00:00:00 2001 From: Stefan Tatschner Date: Wed, 17 Jul 2024 18:32:44 +0200 Subject: [PATCH] fix(log): Fix wrong timezone in logfiles Since 939f26764cbf1e9fc274d912f85d31e0b3235cba the logfiles contained the UTC timezone which is wrong. This patch changes the code such that the timezone is set correctly to the **local** timezone of the current platform. --- src/gallia/log.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallia/log.py b/src/gallia/log.py index 52a01868a..c7b890163 100644 --- a/src/gallia/log.py +++ b/src/gallia/log.py @@ -15,6 +15,7 @@ import socket import sys import tempfile +import time import traceback from collections.abc import Iterator from dataclasses import dataclass @@ -32,7 +33,8 @@ from logging import _ExcInfoType -tz = datetime.datetime.now(datetime.UTC).tzinfo +gmt_offset = time.localtime().tm_gmtoff +tz = datetime.timezone(datetime.timedelta(seconds=gmt_offset)) @unique