10000 gh-111513 by anuragdaksh7 · Pull Request #111613 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111513 #111613

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

Closed
wants to merge 3 commits into from
Closed

gh-111513 #111613

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/_pydatetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ def __new__(cls, year, month=None, day=None):
@classmethod
def fromtimestamp(cls, t):
"Construct a date from a POSIX timestamp (like time.time())."
y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)
y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(float(t))
return cls(y, m, d)

@classmethod
Expand Down Expand Up @@ -1808,6 +1808,7 @@ def fromtimestamp(cls, timestamp, tz=None):
@classmethod
def utcfromtimestamp(cls, t):
"""Construct a naive UTC datetime from a POSIX timestamp."""
t = float(t)
import warnings
warnings.warn("datetime.utcfromtimestamp() is deprecated and scheduled "
"for removal in a future version. Use timezone-aware "
Expand Down
0