problem with strptime and time zone

m_ahlenius ahleniusm at gmail.com
Tue Aug 24 22:07:52 EDT 2010


On Aug 24, 4:16 pm, Alex Willmer <a... at moreati.org.uk> wrote:
> On Aug 24, 9:45 pm, m_ahlenius <ahleni... at gmail.com> wrote:
>
>
>
> > whereas this fails:
> > myStrA = 'Sun Aug 22 19:03:06 PDT'
> > gTimeA = strptime( myStrA, '%a %b %d %H:%M:%S %Z')
> > print "gTimeA = ",gTimeA
>
> > ValueError: time data 'Sun Aug 22 19:03:06 PDT' does not match format
> > '%a %b %d %H:%M:%S %Z'
>
> Support for the %Z directive is based on the values contained in
> tzname and whether daylight is true. Because of this, it is platform-
> specific except for recognizing UTC and GMT which are always known
> (and are considered to be non-daylight savings timezones).
>
> http://docs.python.org/library/time.html
>
> Dateutil has it's own timezone database, so should work reliablyhttp://labix.org/python-dateutil


Thanks much, I missed the directive settings.



More information about the Python-list mailing list