Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!newsreader4.netcologne.de!news.netcologne.de!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.036 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'subject:module': 0.04; 'url:pypi': 0.08; 'stored': 0.13; 'linux).': 0.16; 'utc': 0.16; 'cc:addr:python-list': 0.16; 'linux': 0.17; 'wrote:': 0.18; 'cheers,': 0.20; 'cc:no real name:2**0': 0.21; 'header:In-Reply- To:1': 0.22; 'feb': 0.22; 'module,': 0.23; 'received:209.85.220': 0.25; 'cc:2**0': 0.26; '(in': 0.26; 'message-id:@mail.gmail.com': 0.29; 'cc:addr:python.org': 0.29; 'pm,': 0.29; 'chris': 0.30; 'fri,': 0.34; 'parse': 0.34; 'url:python': 0.35; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'url:org': 0.39; 'received:209': 0.39; 'due': 0.66; 'mean.': 0.73; 'datetime': 0.84; 'notion': 0.84; 'sender:addr:chris': 0.84; 'zone': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=0ZrfOXlG3LVpcacuyJ017yy83IfFG9Hvm45ZuW/j254=; b=BHIxkmUDLkKu8xH35RANp0gax5EUaxAziun3lkBk6Faru1rSAQf1Xnlg43UMNLQmEs 5unl5o9Tu+9d+LJhDAuUyLt1JcohnKabLYTwg7FJQU88uNZl/WUJnQYjBwWYi3zvrko0 3p/AWJ8Xy9tQzFQiYlqC7wDxShvefyh2cOWJI= MIME-Version: 1.0 Sender: chris@rebertia.com In-Reply-To: <20120210222545.4cbe6924@bigfoot.com> References: <20120210222545.4cbe6924@bigfoot.com> Date: Fri, 10 Feb 2012 14:00:16 -0800 X-Google-Sender-Auth: OPetESBkcuIf38qpdb7-sBf7TYk Subject: Re: datetime module and timezone From: Chris Rebert To: Olive Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnOaZiXDVslt7BV2UjZ2gLeX6yb9y/UIbrvjxwAxCHH2VZRutk+o+PRmc4L4IajaiuavLPR Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1328911220 news.xs4all.nl 6945 [2001:888:2000:d::a6]:49490 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20194 On Fri, Feb 10, 2012 at 1:25 PM, Olive wrote: > In the datetime module, it has support for a notion of timezone but is > it possible to use one of the available timezone (I am on Linux). Linux > has a notion of timezone (in my distribution, they are stored > in /usr/share/zoneinfo). I would like to be able 1) to know the current > timezone time.tzname gives the zone names (plural due to DST); time.timezone and time.altzone gives their UTC offsets. > and 2) to be able to use the timezone available on the system. You can use the name to look it up in pytz (http://pypi.python.org/pypi/pytz/ ). And python-dateutil (http://labix.org/python-dateutil ) can apparently parse zoneinfo files, if that's what you mean. Cheers, Chris