Worked on #13 and #4. There are some caching issues left, though. Introduced abstract class Cacheable. Replaced async_pymongo with pymongo
This commit is contained in:
@@ -5,3 +5,8 @@ from zoneinfo import ZoneInfo
|
||||
# TODO Add documentation
|
||||
def get_unix_timestamp(date: datetime, to_utc: bool = False) -> int:
|
||||
return int((date if not to_utc else date.replace(tzinfo=ZoneInfo("UTC"))).timestamp())
|
||||
|
||||
|
||||
# TODO Add documentation
|
||||
def get_utc_now() -> datetime:
|
||||
return datetime.now(tz=ZoneInfo("UTC"))
|
||||
|
Reference in New Issue
Block a user