Kevin Rasmussen <[email protected]> added the comment:
Current behaviour:
```
# python
Python 3.9.1 (default, Dec 18 2020, 05:16:04)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> td = datetime.timedelta(hours=3)
>>> str(td)
'3:00:00'
>>> dt = datetime.datetime.strptime(str(td), "%H:%M:%S")
>>> dt.strftime("%H:%M:%S")
'03:00:00'
>>>
```
Expected behaviour:
```
# python
Python 3.9.1 (default, Dec 18 2020, 05:16:04)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> td = datetime.timedelta(hours=3)
>>> str(td)
'03:00:00'
>>> dt = datetime.datetime.strptime(str(td), "%H:%M:%S")
>>> dt.strftime("%H:%M:%S")
'03:00:00'
>>>
```
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42817>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com