PEP 321: Date/Time Parsing and Formatting

Gerrit Holl gerrit at
Thu Nov 20 17:43:41 CET 2003

A.M. Kuchling wrote:
> >> date.strptime(..., '1992-10-15 12:05:32')?  Does it raise an exception? Does
> >> it silently ignore the time data?  Or is it illegal to use time-related
> >> specifiers such as %H with date.strptime, or date-related ones such as %m
> >> with time.strptime?

> > I don't see the difference between the first and the last one. I am for

> First one:
> date.strptime(..., '1992-10-15 12:05:32') -> ValueError: time value ignored

Well, you asked three questions:
1) Does it raise an Exception?
2) Does it silently ignore the time data?
3) Is it illegal to use time-related ...?

So I'd say this is the 2nd one. The difference I don't see is between
raising an Exception and it being illegal.


255. If he sublet the man's yoke of oxen or steal the seed-corn,
planting nothing in the field, he shall be convicted, and for each one
hundred gan he shall pay sixty gur of corn.
          -- 1780 BC, Hammurabi, Code of Law
Asperger Syndroom - een persoonlijke benadering:
Kom in verzet tegen dit kabinet:

More information about the Python-list mailing list