Closed georgpfolz closed 2 years ago
I'd vote to not change the behavior of this ancient library. The changes to beak existing code in a non-obvious way are too big.
The rule of thumb for non US people is to always use datefmt='international'
.
OK, makes sense.
I stumbled upon this when trying to create a DateTime object like this:
DateTime.DateTime('2.4.2022')
. The result was "DateTime('2022/02/04 00:00:00 GMT+1')" instead of "DateTime('2022/04/02 00:00:00 GMT+2')".First I only saw the difference in the timezone, but obviously the date string is interpreted differently than I expected.
I realize that the correct way to create the object would have been
DateTime.DateTime('2.4.2022', datefmt='international')
.I'm from Austria, so I don't know exactly how dates are used in the US, but according to wikipedia it seems the notation with dots is not used for m/d/Y notation.
Wouldn't it be logical to assume the international order (d.m.Y) for strings with dots rather than the US-based order? (even if the argument datefmt is not passed explicitly)