STINNER Victor added the comment:

The year 1900 is a delibrate choice, it's even documented:
https://docs.python.org/dev/library/datetime.html#strftime-and-strptime-behavior

"For time objects, the format codes for year, month, and day should not be 
used, as time objects have no such values. If they’re used anyway, 1900 is 
substituted for the year, and 1 for the month and day."

> The default year should be <whatever>

If you expect a year, you can easily use dt.replace(year=<whatever>), no?

Or start with a datetime.time object and then build a datetime.datetime using 
the time? It's up to you.

We will not change a default value, it will break the backward compatibility.

----------
nosy: +belopolsky, haypo
resolution:  -> not a bug
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26635>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to