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

DeprecationWarning: datetime.datetime.utcnow() is deprecated #1012

Open
yuvadm opened this issue Oct 27, 2024 · 0 comments · May be fixed by #1014
Open

DeprecationWarning: datetime.datetime.utcnow() is deprecated #1012

yuvadm opened this issue Oct 27, 2024 · 0 comments · May be fixed by #1014

Comments

@yuvadm
Copy link

yuvadm commented Oct 27, 2024

Skyfield is using utcnow() which is being deprecated:

return self.from_datetime(self._utcnow().replace(tzinfo=utc))

This results in warnings being thrown:

.venv/lib/python3.12/site-packages/skyfield/timelib.py:134: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    return self.from_datetime(self._utcnow().replace(tzinfo=utc))
@yuvadm yuvadm changed the title utcnow() is being deprecated DeprecationWarning: datetime.datetime.utcnow() is deprecated Oct 27, 2024
ruitcatarino pushed a commit to ruitcatarino/python-skyfield that referenced this issue Oct 29, 2024
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.

1 participant