| 2329 | return base + otoff - myoff |
| 2330 | |
| 2331 | def __hash__(self): |
| 2332 | if self._hashcode == -1: |
| 2333 | if self.fold: |
| 2334 | t = self.replace(fold=0) |
| 2335 | else: |
| 2336 | t = self |
| 2337 | tzoff = t.utcoffset() |
| 2338 | if tzoff is None: |
| 2339 | self._hashcode = hash(t._getstate()[0]) |
| 2340 | else: |
| 2341 | days = _ymd2ord(self.year, self.month, self.day) |
| 2342 | seconds = self.hour * 3600 + self.minute * 60 + self.second |
| 2343 | self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff) |
| 2344 | return self._hashcode |
| 2345 | |
| 2346 | # Pickle support. |
| 2347 | |