16.20 - Daylight Saving Time and Time Zone Strings Specified As Time Zone Strings - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Detailed Topics

Teradata Database
Teradata Vantage NewSQL Engine
Release Number
March 2019
Content Type
Programming Reference
Publication ID
English (United States)

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 Database 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.

Teradata Database uses a time zone string submitted using an SQL SET TIME ZONE request or by using the tdlocaledef utility (for more information, see Teradata Vantage™ - Database Utilities , B035-1102 ). The time zone string names a rule set to be applied for a session or user. The SET TIME ZONE statement and the tdlocaledef utility use the same time zone strings except that tdlocaledef must also specify a rule that is to be associated with the time zone string.

Teradata Database uses the time zone rule string as an input parameter to the system-defined UDF named GetTimeZoneDisplacement, which is contained in the SYSLIB database. For information about the GetTimeZoneDisplacement UDF, including the rules for adding and modifying time zone strings and their associated rules, see Teradata Vantage™ SQL Date and Time Functions and Expressions, B035-1211. The string is interpreted to determine the hour and minute offsets for a session or for specific users when they log onto Teradata 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.

Only those time zone strings that are not defined in terms of GMT enable automatic adjustments for Daylight Saving Time.The GMT time zone strings are designed to be used for regions and time zones that do not follow Daylight Saving Time.

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” in Teradata Vantage™ SQL Data Definition Language Syntax and Examples, B035-1144 for a complete list of the valid time zone strings.

The following table documents how the system-defined UDF returns values to Teradata Database.

IF the … THEN Teradata Database …
result is valid returns a 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 savings time, and an end timestamp.
value for tzs is not valid aborts the request and returns an error to the requestor.
date is old enough that the system has no information about Daylight Saving Time for it