The ANSI SQL:2011 concept of a time zone does not properly handle the time changes that occur when Daylight Saving Time begins and ends. To deal with the Daylight Saving Time concept, Teradata defines a time zone as a set of rules for converting between UTC and the time in the local time zone. Because the rules and application of Daylight Saving Time vary widely, significant flexibility is required to maintain them correctly.
Daylight Saving Time is the term used in American English. British English uses the equivalent term Summer Time.
The database uses a time zone string submitted using an SQL SET TIME ZONE request. The time zone string names a rule set to be applied for a session or user.
The database uses the time zone rule string as an input parameter to the system-defined UDF named GetTimeZoneDisplacement, which is in the SYSLIB database. The string is interpreted to determine the hour and minute offsets for a session or for specific users when they log on to the database. For each such name, the UDF accesses the rules and information it requires to know what the displacement is depending on the date and time on which it changes from Daylight Saving Time and back.
The UDF is defined with the tzs parameter and returns its time zone displacement result with an INTERVAL HOUR TO MINUTE data type.
See SET TIME ZONE for a complete list of the valid time zone strings.
The following table documents how the system-defined UDF returns values to the database.
Situation | Result |
---|---|
Valid result | Database returns set of rules for every time zone string that describes a valid standard time zone displacement, daylight saving time zone displacement, start time for daylight saving time, and an end timestamp. |
Invalid tzs value | Database ends request and returns error to requestor. |
System has no information about Daylight Saving Time for date |