Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8075

Re: parse date string having "EDT"

From Tim Roberts <timr@probo.com>
Newsgroups comp.lang.python
Subject Re: parse date string having "EDT"
Date 2011-06-20 22:52 -0700
Organization Providenza & Boekelheide, Inc.
Message-ID <3ac007lr1fvviek12a96t0oqoo1g6dee5f@4ax.com> (permalink)
References <b503ac78-b8dd-49bc-b457-c9748d903452@glegroupsg2000goo.googlegroups.com>

Show all headers | View raw


Junaid P V <junu.pv@gmail.com> wrote:
>
>I was trying to parse a date string containing "EDT" time zone
>
>eg: 'Mon Jun 20 14:00:57 EDT 2011'
>
>I tried:
>
>datetime.strptime('Mon Jun 20 14:00:57 EDT 2011', '%a %b %d %H:%M:%S %Z %Y')
>
>But I get error

Right, because strptime doesn't support %Z.  You'll have to handle that
yourself and remove it before conversion.
-- 
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

parse date string having "EDT" Junaid P V <junu.pv@gmail.com> - 2011-06-20 19:56 -0700
  Re: parse date string having "EDT" Ben Finney <ben+python@benfinney.id.au> - 2011-06-21 14:12 +1000
  Re: parse date string having "EDT" Tim Roberts <timr@probo.com> - 2011-06-20 22:52 -0700
    Re: parse date string having "EDT" Ben Finney <ben+python@benfinney.id.au> - 2011-06-21 16:10 +1000
      Re: parse date string having "EDT" Tim Roberts <timr@probo.com> - 2011-06-22 20:55 -0700

csiph-web