utils with now

This commit is contained in:
Cayo Puigdefabregas 2024-05-24 13:14:12 +02:00
parent 0d820b19c4
commit 9690b606e0
1 changed files with 7 additions and 0 deletions

7
util.py Normal file
View File

@ -0,0 +1,7 @@
from datetime import datetime, timezone
def now():
timestamp = datetime.now(timezone.utc).replace(microsecond=0)
formatted_timestamp = timestamp.strftime("%Y-%m-%dT%H:%M:%SZ")
return formatted_timestamp