Intelligent strptime?

Mikael Olofsson mikael at isy.liu.se
Thu Nov 11 06:52:43 EST 1999


Yet another "but in Sweden we do"...

On 10-Nov-99 Gerrit Holl wrote:
 >  Does there exist an intelligent strptime? "26/11/99", for example, can
 >  _only_
 >  mean the 26th November of this year, and the chance that "14:11:12" means
 >  14 november 1912 is very small. Is there a module/function that guesses the
 >  format? There isn't doubt very often, only for 12/11/99, US is 11 december,
 >  Europe is 12 November (isn't it?).
 >  http://www.python.org/mailman/listinfo/python-list

Europe is not homogeneous. Swedes prefer most significant first, so we
would write 991126. Note no slashes, always 6 figures. Zeros are used
at obvious places if some numbers are less than 10, that is April the 
1st 1999 would be 990401.

Swedes accept 26/11/99, because it's still in order of significance,
but sighs "Americans" in the presence of 11/26/99, and we never know
what Americans mean by 1/4/11.

Someone pointed out that it would be bad if the program accepted one
format sometimes, and sometimes not. I couldn't agree more. I would 
probably throw my computer out the window, or if I took the time to
think a bit, only throw the software out the window. 

This problem is in the same division as points, commas, and blanks
in formatting numbers. The same old PITA.

/Mikael

-----------------------------------------------------------------------
E-Mail:  Mikael Olofsson <mikael at isy.liu.se>
WWW:     http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date:    11-Nov-99
Time:    13:33:39

This message was sent by XF-Mail.
-----------------------------------------------------------------------




More information about the Python-list mailing list