You can also check out dateparser
dateparser
provides modules to easily parse localized dates in almost any string formats commonly found on web pages.
Install:
$ pip install dateparser
This is, I think, the easiest way you can parse dates.
The most straightforward way is to use the
dateparser.parse
function, that wraps around most of the functionality in the module.
Sample Code:
import dateparser
t1 = 'Jun 1 2005 1:33PM'
t2 = 'Aug 28 1999 12:00AM'
dt1 = dateparser.parse(t1)
dt2 = dateparser.parse(t2)
print(dt1)
print(dt2)
Output:
2005-06-01 13:33:00
1999-08-28 00:00:00