You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the deprecation of datetime.utcnow(), what is the proper way of passing dates to pyephem?
https://github.com/brandon-rhodes/pyephem/blob/master/ephem/doc/date.rst still shows the utcnow() method. Python's suggested code is to use datetime.now(timezone.utc) but this produces a timezone aware object where utcnow() produces a timezone naive object. Will the timezone aware object cause any problems with pyephem?
The text was updated successfully, but these errors were encountered:
With the deprecation of datetime.utcnow(), what is the proper way of passing dates to pyephem?
Unless Python removes utcnow() entirely, my guess is that I keep the documentation as it is now. The advice to use utcnow() was added to the docs in 2015 and I don't recall having many user problems as a result? So unless it starts causing new problems for people, I think the advice will be kept the same.
Will the timezone aware object cause any problems with pyephem?
Happily, they are fully supported — check out the documentation here for an example:
The release notes for Python 3.12 indicate utcnow() will be removed from a future release (it does not mention a specific release like some of the other deprecations). Using utcnow in Python 3.12 results in a deprecation warning.
With the deprecation of datetime.utcnow(), what is the proper way of passing dates to pyephem?
https://github.com/brandon-rhodes/pyephem/blob/master/ephem/doc/date.rst still shows the utcnow() method. Python's suggested code is to use
datetime.now(timezone.utc)
but this produces a timezone aware object where utcnow() produces a timezone naive object. Will the timezone aware object cause any problems with pyephem?The text was updated successfully, but these errors were encountered: