Intelligent strptime?

Charles G Waldman cgw at fnal.gov
Wed Nov 10 11:54:10 EST 1999


Gerrit Holl writes:
 > 
 > 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?).

I think that there's an ambuguity between US-style MM/DD and
European-style DD/MM whenever the day of the month is 12 or less.   Of 
course when DD==MM then the ambuguity doesn't matter (e.g. 3/3/99).
But that still leaves 11 days in each month which have this ambiguity, 
which comes to 132 days per year.  So, given a 365-day year, 36% of
the dates are ambiguous, which doesn't make "guessing" look like a
very attractive option to me.





More information about the Python-list mailing list