I have a datetime object, for which I want to create a date string according to the OS locale settings (as specified e.g. in Windows'7 region and language settings).
Following Python's datetime formatting documentation, I used the %x
format code which is supposed to output "Locale’s appropriate date representation.". I expect this "representation" to be either Windows "short date" or "Long date" format, but it isn't either one.
(I have the short date format set to d/MM/yyyy
and the long date format to dddd d MMMM yyyy
, but the output is `dd/MM/yy')
What's wrong here: he Python documentation, the Python implementation, or my expectation ? (and how to fix?)