Construct a date from a proleptic Gregorian ordinal. January 1 of year 1 is day 1. Only the year, month and day are non-zero in the result.
(cls, n)
| 968 | |
| 969 | @classmethod |
| 970 | def fromordinal(cls, n): |
| 971 | """Construct a date from a proleptic Gregorian ordinal. |
| 972 | |
| 973 | January 1 of year 1 is day 1. Only the year, month and day are |
| 974 | non-zero in the result. |
| 975 | """ |
| 976 | y, m, d = _ord2ymd(n) |
| 977 | return cls(y, m, d) |
| 978 | |
| 979 | @classmethod |
| 980 | def fromisoformat(cls, date_string): |