10 lines
209 B
Python
10 lines
209 B
Python
|
|
from datetime import datetime, timezone
|
||
|
|
|
||
|
|
|
||
|
|
def utcnow() -> datetime:
|
||
|
|
return datetime.now(timezone.utc)
|
||
|
|
|
||
|
|
|
||
|
|
def utc_from_timestamp(timestamp: float):
|
||
|
|
return datetime.fromtimestamp(timestamp, timezone.utc)
|