From 4c31c891fda1dfe552ad45e99c6bb3caeca336fe Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 24 Dec 2023 18:30:01 +0100 Subject: [PATCH] fix: tz not working --- src/utils/misc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/misc.py b/src/utils/misc.py index a38db4c..5fda0e8 100644 --- a/src/utils/misc.py +++ b/src/utils/misc.py @@ -85,7 +85,9 @@ def exist_post(file_id: int) -> float | None: def time_now() -> float: """get current time with timezone awareness""" - return datetime.now(timezone(session[Config._session_timezone])).timestamp() + return ( + timezone(session[Config._session_timezone]).localize(datetime.now()).timestamp() + ) def create_post(file_id: int, content: str) -> bool: