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)
| 1028 | |
| 1029 | @classmethod |
| 1030 | def fromordinal(cls, n): |
| 1031 | """Construct a date from a proleptic Gregorian ordinal. |
| 1032 | |
| 1033 | January 1 of year 1 is day 1. Only the year, month and day are |
| 1034 | non-zero in the result. |
| 1035 | """ |
| 1036 | y, m, d = _ord2ymd(n) |
| 1037 | return cls(y, m, d) |
| 1038 | |
| 1039 | @classmethod |
| 1040 | def fromisoformat(cls, date_string): |