Ho una stringa di data e ora che non so come analizzarla in Python.Parsing time string in Python
La stringa è così:
Tue May 08 15:14:45 +0800 2012
Ho provato
datetime.strptime("Tue May 08 15:14:45 +0800 2012","%a %b %d %H:%M:%S %z %Y")
ma Python solleva
'z' is a bad directive in format '%a %b %d %H:%M:%S %z %Y'
Secondo Python doc:
%z UTC offset in the form +HHMM or -HHMM (empty string if the the object is naive).
Qual è il formato corretto per analizzare questa stringa temporale?
correlati: [Python: l'analisi data con fuso orario da un'e-mail] (http://stackoverflow.com/q/1790795/4279) – jfs