datetime and strptime

Gerrit Holl gerrit at
Sat Nov 15 21:27:15 CET 2003


it seems the datetime library does not have a .strptime class method.
If I want to create a datetime object from a string, I currently have to do:*time.strptime(s, "%Y%m%d")[:3])

If the format is more complex (not in the order of a timetuple), it is
even more complicated. In my opinion, it would be better to be able to do:, "%Y%m%d")

Is there a particular reason that this is not possible?
Or is the only reason that it hasn't been implemented?

Gerrit, who wanted to write a patch until he saw datetime is written in C.

233. If a builder build a house for some one, even though he has not
yet completed it; if then the walls seem toppling, the builder must make
the walls solid from his own means.
          -- 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