PEP 321: Date/Time Parsing and Formatting

A.M. Kuchling amk at amk.ca
Wed Nov 19 20:16:05 EST 2003


On Wed, 19 Nov 2003 18:42:58 +0100, 
	Gerrit Holl <gerrit at nl.linux.org> 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

Third one:
date.strptime('... %H:%M:%S', '1992-10-15') -> ValueError: can't use %H

--amk




More information about the Python-list mailing list