A variety of programs output date formats according to the syntax of their Unix platforms date command. For example: Tue Nov 5 12:38:00 EST 2013.
How can I easily convert this into a Python date object?
The answer is actually pretty simple. You just need to use the datetime.strptime() method which converts a string representation of a date (1st parameter) into a date object based on a directive which specifies that format of the string representation (2nd parameter).
In this case, this is the code you would use:
import datetime
unix_date_format = '%a %b %d %H:%M:%S %Z %Y'
# Matches strings like Tue Nov 5 12:38:00 EST 2013
my_date = datetime.datetime.strptime(
date_in_string_format, unix_date_format)
Further Reading
datetime.strptime() method