I am new at Python. I was trying to play with time and date objects. I wrote a simple test program to parse a string into a specific time format. But its throwing a ValueError
. Can you please help me out here?
Here is the code:
import time
testDate = "Tuesday, Febuary 23 2011 12:00:00 UTC"
today = time.strptime(testDate,"%A, %B %d %Y %H:%M:%S %Z")
print today
and the error:
Traceback (most recent call last):
File "D:\Python\PythonTest\src\helloWorld.py", line 3, in <module>
today = time.strptime(testDate,"%A, %B %d %Y %H:%M:%S %Z")
File "C:\Python27\Lib\_strptime.py", line 467, in _strptime_time
return _strptime(data_string, format)[0]
File "C:\Python27\Lib\_strptime.py", line 325, in _strptime
(data_string, format))
ValueError: time data 'Tuesday, Febuary 23 2011 12:00:00 UTC' does not match format '%A, %B %d %Y %H:%M:%S %Z'