Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.127 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.75; '*S*': 0.01; 'dan': 0.09; 'subject:question': 0.10; 'cc:addr:python-list': 0.11; 'cc:name:python list': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'library': 0.18; 'wed,': 0.18; 'basically': 0.19; 'select': 0.22; 'cc:addr:python.org': 0.22; 'spring': 0.24; 'cc:2**0': 0.24; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'primarily': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'getting': 0.31; 'usually': 0.31; '25,': 0.31; 'gary': 0.31; 'names.': 0.31; 'subject:time': 0.33; "i'd": 0.34; 'knowledge': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'pacific': 0.36; 'sure': 0.39; 'march': 0.61; 'love': 0.65; 'forward': 0.65; 'city': 0.66; 'hours': 0.66; 'mar': 0.68; 'savings': 0.81; '2015': 0.84; 'back?': 0.84; 'olsen': 0.84; 'subject:savings': 0.84; 'to:none': 0.92; 'political': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=gTS4EM0+rlYkw6NHpuc02j7IeYuHBqc/qHCVOVlDiss=; b=UDxU1OsH/IAToHR5BvpvFiaDDQXhQR2exltGN/lE8mxw9h74hCkHYXAGlYU5EZYvRB aiBP67MfviRaBAUQl3plA+JufHBLx6C7OrhlghCJCTCTQN+69D0wco0ct6r28/EXWjvV JknnGXNZomTHXib7JYDxte97Ur436oeiAo0g1/2M8qUTIAJMZI5hQNuIhjtk5/PH5yAe h5v0eqlmGZsESwe8WPKqLzsfdhUcaIi0EftegLG8AaFE8MpOpT1o3/rauFMAqJO2DYcs yH8KRVXnTagT7xzvAOSW5r+YvUnBQRAvgx23VODNod1kq3gijCKp8giWpxquXRZrWcR/ K8Pw== MIME-Version: 1.0 X-Received: by 10.50.29.109 with SMTP id j13mr25996098igh.2.1427237773278; Tue, 24 Mar 2015 15:56:13 -0700 (PDT) In-Reply-To: References: Date: Wed, 25 Mar 2015 09:56:13 +1100 Subject: Re: Daylight savings time question From: Chris Angelico Cc: Python List Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1427237776 news.xs4all.nl 2856 [2001:888:2000:d::a6]:36738 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87911 On Wed, Mar 25, 2015 at 9:24 AM, Dan Stromberg wrote: > Is there a way of "adding" 4 hours and getting a jump of 5 hours on > March 8th, 2015 (due to Daylight Savings Time), without hardcoding > when to spring forward and when to fall back? I'd love it if there's > some library that'll do this for me. Fundamentally, this requires knowledge of timezone data. That means you have to select a political time zone, which basically means you want the Olsen database (tzdata) which primarily works with city names. I'm not sure whether "US/Pacific" is suitable; I usually use "America/Los_Angeles" for Pacific US time. But that aside, what Gary said is what I would recommend. ChrisA