Spaces:
Running
Running
Download app/utils/time.py from fallingbody/Mockai: direct link, hf CLI and curl.
- Browser
- Download file 286 Bytes
-
https://huggingface.co/spaces/fallingbody/Mockai/resolve/main/app/utils/time.py
- Command line
-
hf download hf://spaces/fallingbody/Mockai/app/utils/time.py
-
curl -L -o time.py https://huggingface.co/spaces/fallingbody/Mockai/resolve/main/app/utils/time.py
286 Bytes
| from datetime import datetime, timezone | |
| def utc_now() -> datetime: | |
| """ | |
| Returns current UTC datetime. | |
| """ | |
| return datetime.now(timezone.utc) | |
| def utc_timestamp() -> int: | |
| """ | |
| Returns current UTC timestamp (seconds). | |
| """ | |
| return int(utc_now().timestamp()) | |