- Contents
Interaction Designer Help
Date/Time Functions
Using Time Zones (TZ) versus Universal Coordinated Time (UTC)
Most of the various date/time functions come in two flavors: time zone (TZ) and Universal Coordinated Time (UTC). UTC, formerly known as Grenwich Mean Time, or GMT, is the same regardless of where you are in the world or whether or not it's Daylight Saving's Time. Time Zone time, on the other hand, differs depending on how far you are from zero longitude and possibly also on what time of year it is. Obviously, calculating the datetime value based on time zones is more complicated than using UTC. This is why all datetime values in CIC are UTC times, and we strongly recommend keeping this standard when creating your handlers.
However, TZ functions are available to you if you want to base your datetime operators on time zone time instead. In the datetime parameters, "TZ" designates the timezone string parameter. These names correspond either to the time zones defined by Windows or to ICU time zone values that are specified in Interaction Administrator configuration.
Some examples of Windows time zones are: Alaskan Standard Time, Arabian Standard Time, Canada Central Standard Time, Central America Standard Time, and Dateline Standard Time. Check the following registry key to get a list of time zones supported on your server:
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones
Interaction Administrator, Interaction Desktop, and other sytems follow the ICU standard for time zones written as configuration information. For more information, refer to http://userguide.icu-project.org/datetime/timezone.
If a timezone (TZ) function is left blank, the timezone will default to the local time of the CIC Server that the handler is running on. However, if a handler author wants to use a non-blank timezone string in a TZ datetime expression editor function, they need to realize that the valid timezone strings can (and will) change on a per server basis.
Note: valid TZ values are defined either by the server or by the Interaction Administrator time zone configuration. CIC reads what is there, but it does not define any values itself. For this reason, the values defined on one server may not be the same as those defined on another. To determine what time zones are defined on your server, you must read the values from the registry.
Using UTC-based datetimes has three advantages over using time zone based datetimes:
-
No calculations are required to convert time from place to place.
-
No possibility of error due to differing definitions of time zones from server to server
-
No need to keep track of what areas do and do not participate in Daylight Savings Time.
However, regardless of how you want to express your datetime values, CIC always uses UTC internally. Whenever a datetime is converted into its TZ equivalant, the underlying value remains unchanged.
Related Topics