> 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.
Does mktime(dt.timetuple()) handle correctly tzinfo? And how do you get a UNIX timestamp in the UTC timezone? (dt.utctotimestamp()) I tried to implement datetime.totimestamp() but I lost my mind in timezone. It took me weeks to understand that the French timezone lost two hour near 1940 because of the World War II (to uniformize French and German timezones)... France has not least than 12 timezones (the country, not Metropolitan France) :-) There is also the question of daylight saving time... Handling time is too complex for my brain :-) So I'm +1 for a simple datetime.totimestamp() method. But I'm unable to write or review it. Victor
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com