Update datetime.py

This commit is contained in:
小染 2023-05-25 16:45:48 +08:00 committed by GitHub
parent 606f586c6d
commit 06988bb196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,9 +55,7 @@ def _ymd2ord(year, month, day):
assert 1 <= month <= 12, 'month must be in 1..12' assert 1 <= month <= 12, 'month must be in 1..12'
dim = _days_in_month(year, month) dim = _days_in_month(year, month)
assert 1 <= day <= dim, ('day must be in 1..%d' % dim) assert 1 <= day <= dim, ('day must be in 1..%d' % dim)
return (_days_before_year(year) + return (_days_before_year(year) + _days_before_month(year, month) + day)
_days_before_month(year, month) +
day)
_DI400Y = _days_before_year(401) # number of days in 400 years _DI400Y = _days_before_year(401) # number of days in 400 years
_DI100Y = _days_before_year(101) # " " " " 100 " _DI100Y = _days_before_year(101) # " " " " 100 "