Possible Duplicate:
Python strptime() and timezones?
I have string like [22/Aug/2012:13:08:27 +0400] and how I can convert it in time tuple with strptime function?
time.strptime(t, '[%d/%b/%Y:%H:%M:%S +0400]')
works but obviously I need format time offset too.
And when I try format +0400 with %Z, I have:
ValueError: time data '[22/Aug/2012:13:08:27 +0400]' does not match format '[%d/%b/%Y:%H:%M:%S %Z]'
and when I try %z
ValueError: 'z' is a bad directive in format '[%d/%b/%Y:%H:%M:%S %z]'