Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!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.128 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.75; '*S*': 0.01; "wouldn't": 0.11; '24,': 0.16; 'correct)': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'integer.': 0.16; 'roy': 0.16; 'wrote:': 0.17; 'feb': 0.19; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message- id:@mail.gmail.com': 0.27; 'could': 0.32; 'to:addr:python-list': 0.33; 'skip:d 20': 0.34; 'received:google.com': 0.34; 'subject:?': 0.35; 'received:209.85': 0.35; 'add': 0.36; 'but': 0.36; 'too': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'gives': 0.39; 'to:addr:python.org': 0.39; 'days': 0.60; 'subject:, ': 0.61; 'skip:6 10': 0.63; 'smith': 0.71; '1970,': 0.84; '2013': 0.84; 'calculations': 0.84; 'do:': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=JdwNd3SByJe2HFGBbzDkElUSyOD5ldmflvRzBxuBMC4=; b=RpTZ7nDvL1Q9s26LdXVjc5GfgC3YT4qyRfu5+iPC2vvB4XhMTskYWJW4j9UJPzwmAK tqLHY7ZpgvJ8FAl/ED7obhxHy6iovcaqdn2U4EMu5tAibCIqjqHbXX8QtJKORb/1VWk7 aOAcuh6KB1wQQrapZEP+jLYwJz1f8KWuhIiBSmwlWMr0TwOS7eOWpnGASXtwDjHjQiab Ko/OB3ojMlJkFyDrye2Cby6tewk21umudIgySwrFgiEKL0wV+1MBMtp6UomeTn64q42/ tvY/2/Q7m4m7fBGjwNrob/z1R3Zz4xW0drbXlI4Pzq+2TbnYT+PoclGcXh4PWGVqRpT7 GAiQ== MIME-Version: 1.0 X-Received: by 10.58.253.161 with SMTP id ab1mr7379029ved.55.1361627105285; Sat, 23 Feb 2013 05:45:05 -0800 (PST) In-Reply-To: References: Date: Sun, 24 Feb 2013 00:45:05 +1100 Subject: Re: time as float since Jan 1, 0001? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361627108 news.xs4all.nl 6870 [2001:888:2000:d::a6]:42324 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39668 On Sun, Feb 24, 2013 at 12:29 AM, Roy Smith wrote: > datetime.toordinal() gives me the number of days since that epoch, but > as an integer. I figured it wouldn't be too hard to just do: > > t.toordinal() + t.time().total_seconds() What about t.timestamp()? That's since 1970, but you could add (if my calculations are correct) 62135683200.0 to it. ChrisA