[issue14908] datetime.datetime should have a timestamp() method

2012-06-08 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I associated my commit with issue 2736 by mistake, but it is probably a good thing because that issue contains a longer history. Closing this as a duplicate. -- resolution: -> duplicate stage: commit review -> committed/rejected status: open ->

[issue14908] datetime.datetime should have a timestamp() method

2012-06-08 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file25858/issue14908.diff ___ Python tracker ___ ___ Python-bugs-list m

[issue14908] datetime.datetime should have a timestamp() method

2012-06-08 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Added ReST documentation. Will commit soon. Merging nosy list from issue 2736. -- nosy: +Jay.Taylor, Neil Muller, amaury.forgeotdarc, andersjm, catlee, davidfraser, erik.stephens, guettli, hodgestar, jribbens, mark.dickinson, ping, pitrou, pyt

[issue14908] datetime.datetime should have a timestamp() method

2012-06-07 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file25854/issue14908.diff ___ Python tracker ___ ___ Python-bugs-list m

[issue14908] datetime.datetime should have a timestamp() method

2012-06-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Updated patch adds a few more tests and improves error handling in C implementation. -- nosy: +haypo Added file: http://bugs.python.org/file25858/issue14908.diff ___ Python tracker

[issue14908] datetime.datetime should have a timestamp() method

2012-06-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I think the attached patch implements what was agreed to on python-dev. We need more tests, particularly around DST change. I tested the patch on OSX, but I am interested to hear feedback from users of other OSes. -- keywords: +patch stage: ne

[issue14908] datetime.datetime should have a timestamp() method

2012-06-05 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky nosy: -Alexander.Belopolsky stage: -> needs patch ___ Python tracker ___ _

[issue14908] datetime.datetime should have a timestamp() method

2012-06-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Barry, I looked at your changeset at http://bazaar.launchpad.net/~gwibber-committers/gwibber/trunk/revision/1354 and at the specification at http://developers.facebook.com/docs/reference/api/event/. Am I correct that you are parsing "string containing

[issue14908] datetime.datetime should have a timestamp() method

2012-06-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jun 4, 2012 at 3:21 PM, Alexandre Zani wrote: > Let me know if I misunderstood Alexander, but if I didn't this should be > documented with > the datetime object. Based upon my understanding, the datetime object is a > bad choice > if you care ab

[issue14908] datetime.datetime should have a timestamp() method

2012-06-04 Thread Alexandre Zani
Alexandre Zani added the comment: I'm still reading through the issue you mentioned. (It's a painful read I have to admit) One major obstacle seems to be that during the DST switch over, an hour gets repeated and so the datetime object is ambiguous. (are you on the first or second hour?) I wo

[issue14908] datetime.datetime should have a timestamp() method

2012-06-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jun 4, 2012 at 1:33 PM, Alexandre Zani wrote: > I think the easiest and most intuitive approach is to simply define > timestamp() > as being the reverse of fromtimestamp(). I would like to invite everyone to review the discussion leading to clos

[issue14908] datetime.datetime should have a timestamp() method

2012-06-04 Thread Alexandre Zani
Alexandre Zani added the comment: I think the easiest and most intuitive approach is to simply define timestamp() as being the reverse of fromtimestamp(). Don't worry about leap seconds and all that stuff. If non-1970 epochs are a concern, this could be renamed to posix_timestamp or some suc

[issue14908] datetime.datetime should have a timestamp() method

2012-06-04 Thread R. David Murray
Changes by R. David Murray : -- nosy: +r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue14908] datetime.datetime should have a timestamp() method

2012-06-04 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jun 04, 2012, at 04:03 PM, Alexander Belopolsky wrote: >That's a valuable experience. How big of a deal was the lack of >.ticks() and .gmticks()? How did you work around it? It was *much* less of an issue than all the magic date format parsing that mxDT

[issue14908] datetime.datetime should have a timestamp() method

2012-06-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jun 4, 2012 at 11:57 AM, Barry A. Warsaw wrote: > I've recently had to convert a bunch of code from using mxDateTime to > datetime+time, That's a valuable experience. How big of a deal was the lack of .ticks() and .gmticks()? How did you work a

[issue14908] datetime.datetime should have a timestamp() method

2012-06-04 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jun 04, 2012, at 03:45 PM, Alexander Belopolsky wrote: >Did you review the long discussion under issue 2736? Specifically, please >note the part about mxDateTime, ticks() and gmticks(). I am -0 on adding >ticks() and gmticks() and as far as I can tell no

[issue14908] datetime.datetime should have a timestamp() method

2012-06-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Barry, Did you review the long discussion under issue 2736? Specifically, please note the part about mxDateTime, ticks() and gmticks(). I am -0 on adding ticks() and gmticks() and as far as I can tell no one has implemented these methods for datetim

[issue14908] datetime.datetime should have a timestamp() method

2012-06-04 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I completely agree. As easy (but obscure) as it is, it seems quite silly to have to go through time.mktime(dt.timetuple()) -- ___ Python tracker ___

[issue14908] datetime.datetime should have a timestamp() method

2012-06-04 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue14908] datetime.datetime should have a timestamp() method

2012-05-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: See issue2736. -- nosy: +Alexander.Belopolsky ___ Python tracker ___ ___ Python-bugs-list mai

[issue14908] datetime.datetime should have a timestamp() method

2012-05-25 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- components: +Library (Lib) nosy: +belopolsky, lemburg type: -> enhancement versions: +Python 3.3 -Python 2.7, Python 3.2 ___ Python tracker ___ __

[issue14908] datetime.datetime should have a timestamp() method

2012-05-25 Thread Dirkjan Ochtman
New submission from Dirkjan Ochtman : There's datetime.fromtimestamp() and datetime.timetuple(), but no datetime.timestamp(). It should be possible to round-trip a UNIX timestamp through a datetime.datetime. -- messages: 161558 nosy: djc priority: normal severity: normal status: open t