Timezone operations - script to Java migration
For the Timezone operations, not all of the script operations from the Script API are implemented in the Java™ API. Alternative Java code is provided for those script operations that are not implemented in the Java API.
| Script operation | Alternative Java code |
|---|---|
| getUserTimeZoneDesc() | getUserTimeZone() TimeZone tz = TimeZone.getTimeZone("IST"); tz.getDisplayName(new Locale("de", "DE")); |
| getUserTimeZoneOffset() | Context ctx = PIMContextFactory.getCurrentContext(); User usr = ctx.getOrganizationManager().getUser("Admin"); String timeZone = usr.getUserSettingValue(UserSetting.TIMEZONE); |
| setUserTimeZone | Context ctx = PIMContextFactory.getCurrentContext(); |
| String parseTimeZoneToDBValue(String srcStr) | getEncodedFormFromOffset(int offset) |
| Number getTimeZoneOffsetFromDBValue(String dbValue) | getOffsetFromEncodedForm(String encodedTimezone) |