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


Groups > comp.lang.python > #60940

Re: I look for a list to convert time zone abbreviation to full time zone in python

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'bishop': 0.09; 'feature.': 0.09; 'function,': 0.09; 'parsing': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'stuart': 0.16; 'subject: \n ': 0.16; 'timezones': 0.16; 'utc': 0.16; 'subject:python': 0.16; '(but': 0.19; 'header:User-Agent:1': 0.23; 'parse': 0.24; 'specify': 0.24; "haven't": 0.24; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'feature': 0.29; 'database,': 0.30; 'dec': 0.30; 'est': 0.30; 'subject:list': 0.30; 'twitter:': 0.31; 'ok.': 0.31; 'blog:': 0.33; 'subject:time': 0.33; 'skip:d 20': 0.34; 'could': 0.34; "can't": 0.35; 'convert': 0.35; 'but': 0.35; 'format.': 0.36; 'possible': 0.36; 'should': 0.36; 'example,': 0.37; 'wrong': 0.37; 'list': 0.37; 'implement': 0.38; 'represent': 0.38; 'auto': 0.38; 'question,': 0.38; 'solving': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'success': 0.61; 'from:charset:utf-8': 0.61; 'back': 0.62; 'map': 0.64; 'klein': 0.68; 'url:info': 0.73; 'discover': 0.82; 'sgt': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Stéphane Klein <contact@stephane-klein.info>
Subject Re: I look for a list to convert time zone abbreviation to full time zone in python
Date Tue, 03 Dec 2013 16:27:15 +0100
References <l7ibsg$m9g$1@ger.gmane.org> <CADmi=6O_Te5L917Z8ihi315Jm_GOQ_N0sxotdAYWJ_dz_8WbzQ@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host 37.162.51.71
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.1.1
In-Reply-To <CADmi=6O_Te5L917Z8ihi315Jm_GOQ_N0sxotdAYWJ_dz_8WbzQ@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3514.1386084450.18130.python-list@python.org> (permalink)
Lines 43
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1386084450 news.xs4all.nl 2961 [2001:888:2000:d::a6]:45233
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:60940

Show key headers only | View raw


Le 03/12/13 11:07, Stuart Bishop a écrit :
> It could go into pytz (but generated from the IANA database, not from
> the list you quote). Whether it should go into pytz is debatable.
> 

Ok.

> If you need to map an abbreviation back to a single timezone you are
> solving the wrong problem, because you can only map an abbreviation
> back to a list of possible timezones (And that list might change when
> the database is corrected). Also, to correctly represent this you need
> to specify the point in time. EST in 'Tue Dec  3 20:44:00 EST 2013'
> maps to about 3 timezones. EST in 'Tue Dec  3 20:44:00 EST 2011' maps
> to about 6.
> 

Ok I understand this now.

My original need is by example, convert

Apr 16 12:09:00 SGT 2010

to UTC format.

I would like to use datetime.datetime.strptime function, but it don't success to
parse %Z param.

pytz haven't parse function.

python-dateutil have a auto discover parse function, but I don't want to use
this auto discover feature.

Question, pytz can't implement a parsing feature ?

Best regards,
Stéphane

-- 
Stéphane Klein <contact@stephane-klein.info>
blog: http://stephane-klein.info
Twitter: http://twitter.com/klein_stephane
cv: http://cv.stephane-klein.info

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


Thread

Re: I look for a list to convert time zone abbreviation to full time zone in python Stéphane Klein <contact@stephane-klein.info> - 2013-12-03 16:27 +0100

csiph-web