Tag archives: python

How to convert string to datetime object in python2.4. strptime usage in Python 2.4

Last update on March 2, 2015.

Python 2.4

datetime(*(time.strptime(date_string, format)[0:6]))

eg:

datetime(*(time.strptime('24/11/2007','%d/%m/%Y')[0:6]))

Python 2.7

datetime.strptime(date_string, format)

eg:
datetime.strptime('24/11/2007','%d/%m/%Y')