Compare commits
No commits in common. "080f0238357436a680f194f57f7142e048ed6bd9" and "3ed06f7c2a99a063c24189803f04aa856a69fe0b" have entirely different histories.
080f023835
...
3ed06f7c2a
2 changed files with 4 additions and 8 deletions
|
@ -26,5 +26,5 @@ for example, using `pass` password:
|
|||
|
||||
```sh
|
||||
$ pip install -r requirements.txt
|
||||
$ TD_USERPASS=pass TZ=UTC FLASK_APP=src/app flask run
|
||||
$ TD_USERPASS=pass FLASK_APP=src/app flask run
|
||||
```
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from datetime import UTC, datetime
|
||||
from datetime import datetime
|
||||
from os import listdir, utime
|
||||
from os import path as os_path
|
||||
from os import remove as os_remove
|
||||
|
@ -98,12 +98,8 @@ def exist_post(file_id: int) -> float | None:
|
|||
|
||||
|
||||
def time_now() -> float:
|
||||
"""get current time based on timezone without being timezone aware"""
|
||||
now = datetime.now(UTC).replace(tzinfo=None)
|
||||
return (
|
||||
now.timestamp()
|
||||
+ timezone(session[Config._session_timezone]).utcoffset(now).total_seconds()
|
||||
)
|
||||
"""get current time based on timezone"""
|
||||
return datetime.now(timezone(session[Config._session_timezone])).timestamp()
|
||||
|
||||
|
||||
def create_post(file_id: int, content: str) -> bool:
|
||||
|
|
Loading…
Reference in a new issue