On Tue, Jun 5, 2012 at 3:45 PM, Guido van Rossum <guido at 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4