Seconds in str(DateTime()) are not zero-padded
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DateTime |
Invalid
|
Medium
|
Unassigned |
Bug Description
__str__() method of DateTime is using '%06.6f' format for seconds, which clearly is not what the author intended. It should be '%09.6f'.
A bad thing is that everyone is using diffrent format string for the same result. For example, the following formats are equivalent: '%02d', '%02.2d', '%2.2d', '%.2d'.
By the way I found a bug in _tzoffset2rfc82
The attached patch will do the following:
- fix __str__ method,
- make all format strings consistent,
- fix _tzoffset2rfc82
- change _findLocalTimeZ
This patch looks reasonable. Needs tests.