Message233215
In C the strptime function doesn't return valid data if an input is invalid.
$ ./strptimetest "0 2015 1" "%W %Y %w"
2015-00--2 00:00:00
$ ./strptimetest "0 2015 2" "%W %Y %w"
2015-00--1 00:00:00
$ ./strptimetest "0 2015 3" "%W %Y %w"
2015-00-00 00:00:00
$ ./strptimetest "0 2015 4" "%W %Y %w"
2015-01-01 00:00:00
$ ./strptimetest "0 2015 5" "%W %Y %w"
2015-01-02 00:00:00
$ ./strptimetest "0 2015 6" "%W %Y %w"
2015-01-03 00:00:00
$ ./strptimetest "0 2015 7" "%W %Y %w"
2015-01-00 00:00:00
So this behavior likely is not a bug and doesn't need to be fixed in maintained releases. But it would be good to make strptime() more consistant and either extend it to support week and weekday numbers out of current valid range, or raise an exception. |
|
Date |
User |
Action |
Args |
2014-12-30 18:45:17 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, belopolsky, torm |
2014-12-30 18:45:17 | serhiy.storchaka | set | messageid: <1419965117.01.0.704804987935.issue23134@psf.upfronthosting.co.za> |
2014-12-30 18:45:16 | serhiy.storchaka | link | issue23134 messages |
2014-12-30 18:45:16 | serhiy.storchaka | create | |
|