Jan-02-2020, 02:31 AM
(This post was last modified: Jan-02-2020, 02:31 AM by 10OctNotOct10a1.)
(Dec-31-2019, 06:22 PM)ndc85430 Wrote: What? Those outputs are literally the same. In any case, I don't believe you when you say it's broken, not least because if it was someone would have noticed by now. An example where the month and day are different:Yeah, that's the problem doing
$ python3 Python 3.6.2 (default, Oct 5 2017, 12:21:44) [GCC 5.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> datetime.datetime(2019, 11, 10).strftime('%d/%m/%Y') '10/11/2019' >>>
datetime.datetime(2019, 11, 10).strftime('%d/%m/%Y')returns October 11, 2019 instead of 11 October 2019. But this:
datetime.datetime(2019, 31, 12).strftime('%d/%m/%Y')should return 31/12/2019 instead of throwing an error.
It's interesting that datetime only isn't broken when the day and the month syntaxes are the same. It's a coincidence that I had this problem on 10/10, thus it shows the same thing and I didn't realise this.
Any solution, it seems that only does what I wanted the datetime module to do on 1/1, 2/2, 3/3, 4/4, 5/5, 6/6, 7/7, 8/8, 9/9, 10/10, 11/11 and 12/12