I am not sure what is wrong with the formatting of %a %b %d %H:%M:%S %Z %Y
I have attached the code and error message below.
Code:
print(data[1][0])
t1 = datetime.strptime(data[1][0], "%a %b %d %H:%M:%S %Z %Y")
Error Message:
Fri Jul 08 12:02:39 PDT 2022
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/tmp/ipykernel_116/256248471.py in <module>
2
3 print(data[1][0])
----> 4 t1 = datetime.strptime(data[1][0], "%a %b %d %H:%M:%S %Z %Y")
/opt/conda/lib/python3.9/_strptime.py in _strptime_datetime(cls, data_string, format)
566 """Return a class cls instance based on the input string and the
567 format string."""
--> 568 tt, fraction, gmtoff_fraction = _strptime(data_string, format)
569 tzname, gmtoff = tt[-2:]
570 args = tt[:6] + (fraction,)
/opt/conda/lib/python3.9/_strptime.py in _strptime(data_string, format)
347 found = format_regex.match(data_string)
348 if not found:
--> 349 raise ValueError("time data %r does not match format %r" %
350 (data_string, format))
351 if len(data_string) != found.end():
ValueError: time data 'Fri Jul 08 12:02:39 PDT 2022' does not match format '%a %b %d %H:%M:%S %Z %Y'