jaraco / tempora

MIT License
20 stars 7 forks source link

strftime should render even for unrelated attributes #11

Closed jaraco closed 4 years ago

jaraco commented 4 years ago

The upstream strftime allows formatting to be applied to attributes not present on the object, such as a year on a time object or a microsecond on a date object:

>>> import datetime
>>> datetime.date(1900,1,1).strftime('%f')
'000000'
>>> datetime.time(0).strftime('%Y')
'1900'

This behavior is documented but discouraged.

tempora.strftime should retain that behavior.