[Python-Dev] Issue 2736: datetimes and Unix timestamps (original) (raw)

Dirkjan Ochtman dirkjan at ochtman.nl
Mon Jun 4 13:19:14 CEST 2012


I recently opened issue14908. At work, I have to do a bunch of things with dates, times and timezones, and sometimes Unix timestamps are also involved (largely for easy compatibility with legacy APIs). I find the relative obscurity when converting datetimes to timestamps rather painful; IMO it should be possible to do everything I need straight from the datetime module objects, instead of having to involve the time or calendar modules.

Anyway, I was pointed to issue 2736, which seems to have got a lot of discouraged core contributors (Victor, Antoine, David and Ka-Ping, to name just a few) up against Alexander (the datetime maintainer, AFAIK). It seems like a fairly straightforward case of practicality over purity: Alexander argues that there are "easy" one-liners to do things like datetime.totimestamp(), but most other people seem to not find them so easy. They've since been added to the documentation at least, but I would like to see if there is consensus on python-dev that adding a little more timestamp support to datetime objects would make sense.

I hope this won't become another epic issue like the last time-related issue...

Cheers,

Dirkjan



More information about the Python-Dev mailing list