from datetime import datetime
DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S'
time = datetime.now()
time
time = time.strftime(DATETIME_FORMAT)
time
import json
time = json.loads(json.dumps(time))
time
time = datetime.strptime(time, DATETIME_FORMAT)
time
Python: Convert simplejson dumped unicode datetime back to datetime object