MCPcopy Index your code
hub / github.com/python/cpython / toordinal

Method toordinal

Lib/_pydatetime.py:1165–1171  ·  view source on GitHub ↗

Return proleptic Gregorian ordinal for the year, month and day. January 1 of year 1 is day 1. Only the year, month and day values contribute to the result.

(self)

Source from the content-addressed store, hash-verified

1163 0, 0, 0, -1)
1164
1165 def toordinal(self):
1166 """Return proleptic Gregorian ordinal for the year, month and day.
1167
1168 January 1 of year 1 is day 1. Only the year, month and day values
1169 contribute to the result.
1170 """
1171 return _ymd2ord(self._year, self._month, self._day)
1172
1173 def replace(self, year=None, month=None, day=None):
1174 """Return a new date with new values for the specified fields."""

Callers 15

ctimeMethod · 0.95
__add__Method · 0.95
__sub__Method · 0.95
weekdayMethod · 0.95
isoweekdayMethod · 0.95
_strptimeFunction · 0.80
ctimeMethod · 0.80
__add__Method · 0.80
__sub__Method · 0.80
calendar.pyFile · 0.80
timegmFunction · 0.80

Calls 1

_ymd2ordFunction · 0.85

Tested by 8

test_extreme_ordinalsMethod · 0.64
test_subclass_dateMethod · 0.64
test_more_timetupleMethod · 0.64
test_utctimetupleMethod · 0.64
fromutcMethod · 0.64
_find_tiMethod · 0.64