New submission from Jason R. Coombs <jar...@jaraco.com>:

On Python 3.8, there's a difference between how datetime.datetime.strftime 
renders %Y for years < 1000 between Linux and other platforms.

# Linux
$ docker run -it python python -c 'import datetime; 
print(datetime.date(900,1,1).strftime("%Y"))'                       
900

# macOS
$ python -c 'import datetime; print(datetime.date(900,1,1).strftime("%Y"))'     
                                        
0900


According to the docs 
(https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior), 
one should expect `'0000'` for year zero and so I'd expect `'0900'` for the 
year 900, so the macOS behavior looks correct to me.

----------
components: Library (Lib)
messages: 358695
nosy: jaraco
priority: normal
severity: normal
status: open
title: [linux] strftime renders %Y with only 3 characters
versions: Python 3.8

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

Reply via email to