Path: csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4.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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'anyway.': 0.05; 'one?': 0.05; 'subject:Python': 0.06; 'method.': 0.07; 'cc:addr:python- list': 0.11; 'python': 0.11; 'jan': 0.12; '3.3,': 0.16; 'experiments': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'roy': 0.16; 'timestamp': 0.16; 'utc': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'subject:the': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'representing': 0.36; 'method': 0.36; 'needed': 0.38; 'pm,': 0.38; 'obtain': 0.39; 'problems.': 0.60; 'simply': 0.61; 'kept': 0.65; 'world': 0.66; 'note:': 0.66; 'smith': 0.68; 'gain': 0.79; 'discovered': 0.83; 'to:none': 0.92 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=Vw8M87VBsRrCaHpkdghdp3KAJcF/VAZJ+mOh4e9f034=; b=xWQ+yZyRd27d4s8PMOHxmnCyGUAW6zPrJbjcvsIe2AuhuAUsyXNLy66BcLC8YztKbP BO9KJPNhcg2jfieYVF+YOK4jxU3SKY0K7ggS7Qc4ZPIjp2Q4Gdnp/7/pniM6GcWHRE78 SFGEnTXKTC2h6I0F+uZPEjNLF3p3YFGVUK2LsdRrj7qxPJAOCPKHPVQn6hSP+Cu5Q0C1 i2sNvyDETuPH21Pc2YlVAeIndzK1C4+RI2vjI5yZfSs8/Sm2qYcq5syZZZbYNs1R7ILm hmOgjtmab+UaecgwN+PxaQwnXzW6Tw7vRsQF5iVnPqtPoVWAvlWtJ5NuoBFlbWY3+hZd Sw5Q== MIME-Version: 1.0 X-Received: by 10.68.183.164 with SMTP id en4mr318700pbc.169.1389232073928; Wed, 08 Jan 2014 17:47:53 -0800 (PST) In-Reply-To: References: <78d91$52cbf8e9$541826b9$29485@cache1.tilbu1.nb.home.nl> <4b702$52cc262e$541826b9$22985@cache80.multikabel.net> <4cbf$52cc2e82$541826b9$11761@cache70.multikabel.net> <686$52cd4640$541826b9$21896@cache1.tilbu1.nb.home.nl> Date: Thu, 9 Jan 2014 12:47:53 +1100 Subject: Re: the Gravity of Python 2 From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 1389232077 news.xs4all.nl 2937 [2001:888:2000:d::a6]:60527 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63552 On Thu, Jan 9, 2014 at 12:27 PM, Roy Smith wrote: > Anyway, I discovered that Python 3.3's datetime has a .timestamp() > method. Yeah. Finally. Exactly what the world had needed for years. > Then I kept reading and found: > > Note: There is no method to obtain the POSIX timestamp directly from a > naive datetime instance representing UTC time. In my experiments (admittedly with 3.4, not 3.3, but I don't know that there's any difference), I was able to round-trip a time_t through datetime with no problems. Why not simply use a UTC datetime instead of a naive one? What do you gain by using a naive datetime? You seem to know what timezone it's in anyway. ChrisA