Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datetime.utcnow and datetime.utcfromtimestamp are deprecated in Python 3.12 #49

Closed
tirkarthi opened this issue Jul 12, 2023 · 1 comment · Fixed by #52
Closed

datetime.utcnow and datetime.utcfromtimestamp are deprecated in Python 3.12 #49

tirkarthi opened this issue Jul 12, 2023 · 1 comment · Fixed by #52

Comments

@tirkarthi
Copy link

datetime.datetime’s utcnow() and utcfromtimestamp() are deprecated and will be removed in a future version. Instead, use timezone-aware objects to represent datetimes in UTC: respectively, call now() and fromtimestamp() with the tz parameter set to datetime.UTC. (Contributed by Paul Ganssle in python/cpython#103857.)

croniter/src/croniter/tests/test_croniter.py
960:            dt = datetime.utcfromtimestamp(c.get_next())
980:            dt = datetime.utcfromtimestamp(c.get_next())
1003:            dt = datetime.utcfromtimestamp(c.get_next())

croniter/src/croniter/croniter.py
230:        result = datetime.datetime.utcfromtimestamp(timestamp)
862:        start, stop = (datetime.datetime.utcfromtimestamp(t) for t in (start, stop))
@kiorky
Copy link
Owner

kiorky commented Jul 15, 2023

I do not see a fix for now, as i m not willing to drop support for python2...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants