Python date string to date object
import datetime
datetime.datetime.strptime('24052010', '%d%m%Y').date()
You can use strptime
in the datetime
package of Python:
>>> import datetime
>>> datetime.datetime.strptime('24052010', "%d%m%Y").date()
datetime.date(2010, 5, 24)