| 2220 | return base + otoff - myoff |
| 2221 | |
| 2222 | def __hash__(self): |
| 2223 | if self._hashcode == -1: |
| 2224 | if self.fold: |
| 2225 | t = self.replace(fold=0) |
| 2226 | else: |
| 2227 | t = self |
| 2228 | tzoff = t.utcoffset() |
| 2229 | if tzoff is None: |
| 2230 | self._hashcode = hash(t._getstate()[0]) |
| 2231 | else: |
| 2232 | days = _ymd2ord(self.year, self.month, self.day) |
| 2233 | seconds = self.hour * 3600 + self.minute * 60 + self.second |
| 2234 | self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff) |
| 2235 | return self._hashcode |
| 2236 | |
| 2237 | # Pickle support. |
| 2238 | |