fix: the timestamp should be ok now
All checks were successful
ci/woodpecker/push/publish Pipeline was successful
All checks were successful
ci/woodpecker/push/publish Pipeline was successful
This commit is contained in:
parent
852a30229d
commit
6912a8d7d3
1 changed files with 6 additions and 2 deletions
|
@ -84,8 +84,12 @@ def exist_post(file_id: int) -> float | None:
|
||||||
|
|
||||||
|
|
||||||
def time_now() -> float:
|
def time_now() -> float:
|
||||||
"""get current time with timezone awareness"""
|
"""get current time based on timezone"""
|
||||||
return datetime.now(timezone(session[Config._session_timezone])).timestamp()
|
now = datetime.utcnow()
|
||||||
|
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:
|
||||||
|
|
Loading…
Reference in a new issue