| 2372 | return base + otoff - myoff |
| 2373 | |
| 2374 | def __hash__(self): |
| 2375 | if self._hashcode == -1: |
| 2376 | if self.fold: |
| 2377 | t = self.replace(fold=0) |
| 2378 | else: |
| 2379 | t = self |
| 2380 | tzoff = t.utcoffset() |
| 2381 | if tzoff is None: |
| 2382 | self._hashcode = hash(t._getstate()[0]) |
| 2383 | else: |
| 2384 | days = _ymd2ord(self.year, self.month, self.day) |
| 2385 | seconds = self.hour * 3600 + self.minute * 60 + self.second |
| 2386 | self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff) |
| 2387 | return self._hashcode |
| 2388 | |
| 2389 | # Pickle support. |
| 2390 | |