Actions
Bug #8941
closedstrptime %Y parsing
Description
Time.strptime("1", "%Y")
=> 0001-01-01 00:00:00 +0642
Is it expected behavior?
strftime docs say this:
# %Y - Year with century (can be negative, 4 digits at least)
# -0001, 0000, 1995, 2009, 14292, etc.
So I would expect it to parse only 4 digits as well, as when some parsed data changes format from 2013 to 13 I would better get an error, but I just get 0013 year. By the way, Python's strptime seems to accept only 4 digit years.
Updated by nobu (Nobuyoshi Nakada) about 11 years ago
- Category set to lib
- Status changed from Open to Assigned
- Assignee set to tadf (tadayoshi funaba)
Updated by tadf (tadayoshi funaba) about 11 years ago
- Category changed from lib to Joke
- Status changed from Assigned to Rejected
- Priority changed from Normal to 3
we don't need any bug reports for python.
ruby's one isn't wrong.
Actions
Like0
Like0Like0