I've got this date time string:
post["date"] = "2007-07-18 10:03:19"
The other two answers are fine, but if you actually want the date for something else, you can use the
from datetime import datetime d = datetime.strptime('2007-07-18 10:03:19', '%Y-%m-%d %H:%M:%S') day_string = d.strftime('%Y-%m-%d')
It might be overkill for now, but it'll come in useful. You can see all of the format specifiers here.