Skip to content

Commit 6d7b7e8

Browse files
Move location
1 parent 0306783 commit 6d7b7e8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/_pydatetime.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,10 @@ def toordinal(self):
11621162
"""
11631163
return _ymd2ord(self._year, self._month, self._day)
11641164

1165+
def timestamp(self):
1166+
"""Return POSIX timestamp as float (midnight UTC)."""
1167+
return float((self.toordinal() - _DATE_EPOCH) * 86400)
1168+
11651169
def replace(self, year=None, month=None, day=None):
11661170
"""Return a new date with new values for the specified fields."""
11671171
if year is None:
@@ -1241,10 +1245,6 @@ def weekday(self):
12411245
"Return day of the week, where Monday == 0 ... Sunday == 6."
12421246
return (self.toordinal() + 6) % 7
12431247

1244-
def timestamp(self):
1245-
"""Return POSIX timestamp as float (midnight UTC)."""
1246-
return float((self.toordinal() - _DATE_EPOCH) * 86400)
1247-
12481248
# Day-of-the-week and week-of-the-year, according to ISO
12491249

12501250
def isoweekday(self):

0 commit comments

Comments
 (0)