From 3ed06f7c2a99a063c24189803f04aa856a69fe0b Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 17 Nov 2024 17:09:59 +0100 Subject: [PATCH] fix time now --- src/utils/misc.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/utils/misc.py b/src/utils/misc.py index 2f30d61..29f9e21 100644 --- a/src/utils/misc.py +++ b/src/utils/misc.py @@ -99,11 +99,7 @@ def exist_post(file_id: int) -> float | None: def time_now() -> float: """get current time based on timezone""" - now = datetime.now(datetime.timezone.utc) - return ( - now.timestamp() - + timezone(session[Config._session_timezone]).utcoffset(now).total_seconds() - ) + return datetime.now(timezone(session[Config._session_timezone])).timestamp() def create_post(file_id: int, content: str) -> bool: