On Tue, Jun 5, 2012 at 9:45 AM, Guido van Rossum <guido at python.org> wrote: > TZ-less datetimes aren't going away and have > plenty of use in contexts where the tz is either universally known or > irrelevant. I agree, but in these contexts naive datetime objects almost always represent local time in some "universally known or irrelevant" timezone. I rarely see people use naive datetime objects to represent UTC time and with timezone.utc added to datetime module already the cost of supplying tzinfo to UTC datetime objects is low. Based on tracker comments, I believe users ask for the following function: def timestamp(self, dst=-1): "Return POSIX timestamp as float" if self.tzinfo is None: return _time.mktime((self.year, self.month, self.day, self.hour, self.minute, self.second, -1, -1, dst)) + self.microsecond / 1e6 else: return (self - _EPOCH).total_seconds() You seem to advocate for def utctimestamp(self): return (self - _EPOCH).total_seconds() in addition or instead of timestamp(). In mxDT, utctimestamp() is called gmticks(). Is this an accurate summary?
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