On Tue, Jun 5, 2012 at 3:45 PM, Guido van Rossum <gu...@python.org> wrote: > For datetimes with tzinfo, dt.totimestamp() should return (dt - > epoch).total_seconds() where epoch is > datetime.datetime.fromtimestamp(0, datetime.timezone.utc); for > timezones without tzinfo, a similar calculation should be performed > assuming local time. The utctotimestamp() method should insist that dt > has no tzinfo and then do a similar calculation again assuming the > implied UTC timezone.
It would be nice if utctotimestamp() also worked with datetimes that have tzinfo set to UTC. And while I don't think we really need it, if there are concerns that some other epochs may be useful, we could add an optional epoch argument. Cheers, Dirkjan _______________________________________________ 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