File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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 ):
You can’t perform that action at this time.
0 commit comments