On Wed, Dec 18, 2019 at 5:57 AM Barry Scott <ba...@barrys-emacs.org> wrote: > > > > > On 17 Dec 2019, at 10:37, Ulrich Goebel <m...@fam-goebel.de> wrote: > > > > Hi, > > > > I need to interpret a date string to get a datetime object. That should be > > done with strptime from the module datetime. > > > > But I don't know enough about the locale settings from where the date sting > > comes. Actually the date_string cames from different contact forms inside > > websites made by different content management systems. So it could be > > Can side step the issue? > > I would change the web site to collect the date in a form that is not > ambiguous. > For example use a Javascript date picker widget. > > Barry
No JavaScript needed, just use <input type=date>. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date You get back an unambiguous yyyy-mm-dd. ChrisA -- https://mail.python.org/mailman/listinfo/python-list