Fully documented and updated PycordEvent (#4)
This commit is contained in:
@@ -3,5 +3,5 @@ from zoneinfo import ZoneInfo
|
||||
|
||||
|
||||
# TODO Add documentation
|
||||
def get_unix_timestamp(date: datetime) -> int:
|
||||
return int((date.replace(tzinfo=ZoneInfo("UTC"))).timestamp())
|
||||
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())
|
||||
|
Reference in New Issue
Block a user