G
Gerrit Holl
Hi,
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:
datetime.date(*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:
datetime.date.strptime(s, "%Y%m%d")
Is there a particular reason that this is not possible?
Or is the only reason that it hasn't been implemented?
yours,
Gerrit, who wanted to write a patch until he saw datetime is written in C.
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:
datetime.date(*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:
datetime.date.strptime(s, "%Y%m%d")
Is there a particular reason that this is not possible?
Or is the only reason that it hasn't been implemented?
yours,
Gerrit, who wanted to write a patch until he saw datetime is written in C.