15.00 - Daylight Saving Time and Time Zone Strings Specified As Time Zone Strings - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

prodname
Teradata Database
vrm_release
15.00
category
Programming Reference
featnum
B035-1184-015K

Daylight Saving Time and Time Zone Strings Specified As Time Zone Strings

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.

To do this, Teradata Database uses a time zone string submitted using an SQL SET TIME ZONE request or by using the tdlocaledef utility (see Utilities: Volume 2 (L-Z)). 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 (see SQL Functions, Operators, Expressions, and Predicates for information about the GetTimeZoneDisplacement UDF, including the rules for adding and modifying time zone strings and their associated rules). 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.

Note: 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 SQL Data Definition Language Syntax and Examples 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

See SQL Functions, Operators, Expressions, and Predicates for more details about the GetTimeZoneDisplacement UDF.