I have the following format:
"Wed Jun 25 15:38:29 PDT 2014" and I would like to convert it to "2014-06-25 15:38:29", i.e. "%Y-%m-%d %H:%M:%S"
Code:
import time
import datetime
rawtime = "Wed Jun 25 15:38:29 PDT 2014"
dt = time.strptime(rawtime, "%Y-%m-%d %H:%M:%S")
print dt
I get the error:
ValueError: time data 'Wed Jun 25 15:38:29 PDT 2014\n' does not match format '%Y-%m-%d %H:%M:%S'
strptime, not the format you want it to be!