New submission from Abhisek Maiti <[email protected]>:
`
from datetime import time
t = time(13, 5, 45)
`
While `t.year`, `t.month` and `t.day` results into `AttributeError` the
following:
`
t.strftime('%Y : %B : %d - %H : %M : %S')
`
generates:
`
1900 : January : 01 - 13 : 05 : 45
`
This is unexpected behavior since `datetime.time` object does not have those
attributes. The documentation at
https://docs.python.org/3/library/datetime.html specifically states that
"
class datetime.time
An idealized time, independent of any particular day, assuming that every
day has exactly 24*60*60 seconds (there is no notion of “leap seconds” here).
Attributes: hour, minute, second, microsecond, and tzinfo.
"
----------
components: Library (Lib)
messages: 351580
nosy: Abhisek Maiti
priority: normal
severity: normal
status: open
title: datetime.time object incorrectly shows associated date in strftime()
output
type: behavior
versions: Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue38082>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com