homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: datetime weekday() function
Type: behavior Stage:
Components: Versions: Python 2.5
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: ryanboesch, tim.peters
Priority: normal Keywords:

Created on 2008年07月10日 19:39 by ryanboesch, last changed 2022年04月11日 14:56 by admin. This issue is now closed.

Messages (2)
msg69517 - (view) Author: ryanboesch (ryanboesch) Date: 2008年07月10日 19:39
Leap year ignored each century (2100, 2200, 2300, etc.) except 2000 for
the weekday() function. This code reproduces the error:
import datetime
datetime.date(2100,2,29).weekday()
Error message:
ValueError: day is out of range for the month
Also, this causes the weekday to be 1 day off from March 1st, 2100 to
February 28th 2200 and 2 days off...
msg69518 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2008年07月10日 20:32
The error message is correct. In the Gregorian calendar, years
divisible by 100 are not leap years, unless they're also divisible by
400. So 2000, 2400, 2800, ..., are leap years, but 2100, 2200, 2300,
2500, 2600, 2700, 2900, ... are not leap years. Look it up (anywhere ;-)).
History
Date User Action Args
2022年04月11日 14:56:36adminsetgithub: 47586
2008年07月16日 02:40:35georg.brandlsetstatus: open -> closed
resolution: wont fix
2008年07月10日 20:32:54tim.peterssetnosy: + tim.peters
messages: + msg69518
2008年07月10日 19:39:41ryanboeschcreate

AltStyle によって変換されたページ (->オリジナル) /