Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #39668
| References | <roy-41E67E.08290123022013@news.panix.com> |
|---|---|
| Date | 2013-02-24 00:45 +1100 |
| Subject | Re: time as float since Jan 1, 0001? |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2343.1361627108.2939.python-list@python.org> (permalink) |
On Sun, Feb 24, 2013 at 12:29 AM, Roy Smith <roy@panix.com> 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
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
time as float since Jan 1, 0001? Roy Smith <roy@panix.com> - 2013-02-23 08:29 -0500
Re: time as float since Jan 1, 0001? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-02-23 13:41 +0000
Re: time as float since Jan 1, 0001? Roy Smith <roy@panix.com> - 2013-02-23 08:49 -0500
Re: time as float since Jan 1, 0001? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-02-23 14:08 -0500
Re: time as float since Jan 1, 0001? Chris Angelico <rosuav@gmail.com> - 2013-02-24 00:45 +1100
csiph-web