companion
companion copied to clipboard
The utcnow() method will be deprecated soon. Replaced it with recommened method.
Hey I noticed that at some places the utcnow() method has been use.
Since the function will be deprecated soon I have replaced this with the recommended one.
from datetime import datetime, UTC
print(datetime.now(UTC))
Hey @asifrahaman13! Thanks for the PR 🙂 there are a few details but at high level, the old syntax gets deprecated in Python 3.12. Datetime being part of the standard library, it follows python version, and currently the lib supports Python from 3.9 on. As you can see, mypy indicates that UTC cannot be imported from datetime in python 3.9 😅
So either:
- there is another way to do this that is valid for 3.9 and 3.12
- or we'll have to find another way
Btw, it seems you have run the formater / linter, have you installed precommit hooks? 🙂
Cheers
Hey @frgfm
Thanks for the clarification. Sorry I guess I did not configured it correctly. Will do it soon!