fix time now
All checks were successful
Publish latest version / build (push) Successful in 31s

This commit is contained in:
Mylloon 2024-11-17 17:09:59 +01:00
parent c53825fed1
commit 3ed06f7c2a
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -99,11 +99,7 @@ def exist_post(file_id: int) -> float | None:
def time_now() -> float: def time_now() -> float:
"""get current time based on timezone""" """get current time based on timezone"""
now = datetime.now(datetime.timezone.utc) return datetime.now(timezone(session[Config._session_timezone])).timestamp()
return (
now.timestamp()
+ timezone(session[Config._session_timezone]).utcoffset(now).total_seconds()
)
def create_post(file_id: int, content: str) -> bool: def create_post(file_id: int, content: str) -> bool: