[issue40908] datetime strftime with %Y and 2 digit years

2020-06-08 Thread Paul Ganssle
Paul Ganssle added the comment: This is a duplicate of bpo-13305 and is due to platform-specific implementations of %Y. On Linux, `strftime()` does not zero-pad to 4, and if you need to represent years <1000, you should use "%4Y" to zero-pad the output. I think the ideal resolution would be

[issue40908] datetime strftime with %Y and 2 digit years

2020-06-08 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +belopolsky, p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue40908] datetime strftime with %Y and 2 digit years

2020-06-08 Thread laurent chriqui
New submission from laurent chriqui : When you use strftime with a 2 digit year i.e. '32' it outputs a '32' instead of '0032'. This prevents parsing the string again with the same format through strftime. Exemple: import datetime datetime_format="%Y" date=datetime.date(32,1,1) date_str=date