def setTimeZone(self, tzInfo): self.timeZone = tzInfo setLocalTimezone(tzInfo.getPyTimeZone()) userPrefs = self.applicationModel.getUserProfile().getPreferences() if tzInfo: userPrefs.setUserPreference(IZAppUserPrefsKeys.TIMEZONE, tzInfo.getName()) else: userPrefs.setUserPreference(IZAppUserPrefsKeys.TIMEZONE, u"") #$NON-NLS-1$
def _configureTimeZone(self): # 1) look for a command-line override # 2) look for a user prefs override # 3) try to figure out the TZ from the time.tzname info # 4) do nothing tzName = self._getCommandLineTZOverride() if tzName is None: tzName = self._getUserPrefsTZOverride() if tzName is None: tzName = self._divineTZFromPython() # Now, try to set the timezone if one was found if tzName is not None: tz = self.findTimeZone(tzName) if tz is not None: self.timeZone = tz setLocalTimezone(tz.getPyTimeZone())