Hello,
I'm using this to convert date time strings to a unix timestamp:
str(int(time.mktime(time.strptime(date,"%d %b %Y %H:%M:%S %Z"))))
However often the date structure isn't the same so I keep getting the following error message:
time data did not match format: data=Tue, 26 May 2009 19:58:20 -0500 fmt=%d %b %Y %H:%M:%S %Z
Does anyone know of any simply function to convert a string representation of a date/time to a unix timestamp in python? I really don't want to have to open a process to call a php script to echo the timestamp everytime time in a loop :)