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

Alexander Belopolsky report at bugs.python.org
Mon Jun 4 19:45:52 CEST 2012


Alexander Belopolsky <alexander.belopolsky at gmail.com> added the comment:

On Mon, Jun 4, 2012 at 1:33 PM, Alexandre Zani <report at bugs.python.org> 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
closing of issue 2736.   We cannot implement "the reverse of
fromtimestamp()" because fromtimestamp() is not reversible in presence
of DST and because float cannot represent all values that datetime
supports.  Both issues can be resolved, but I did not see any solution
that I would call intuitive.

Is anyone motivated enough to port mxDT's ticks() method to datetime?
I don't think we need to reinvent the wheel.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14908>
_______________________________________


More information about the Python-bugs-list mailing list