TimeDateWZControl - Advanced SQL Engine - Teradata Database

Database Utilities

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
xha1591998860283.ditamap
dita:ditavalPath
xha1591998860283.ditaval
dita:id
B035-1102
lifecycle
previous
Product Category
Teradata Vantage™
Determines how TIME and TIMESTAMP data is stored in the Teradata file system. Also determines whether the built-in functions CURRENT_TIME, CURRENT_TIMESTAMP, and CURRENT_DATE reflect the session time and session time zone offset.
This field does not affect the output of the DATE and TIME built-in functions.

Field Group

General

Valid Settings

Setting Description
0 Disabled. The values returned by the built-in time and date functions reflect the time value local to the database server, but the time zone value that is defined for user or session. This is identical to a setting of 1.
1 Disabled. The values returned by the built-in time and date functions reflect the time value local to the database server, but the time zone value that is defined for user or session. This is identical to a setting of 0.
2 Enabled. The values returned by the built-in time and date functions reflect the session time and session time zone. DateTime values are stored in the database as UTC.
3 Enabled. The values returned by the built-in time and date functions reflect the session time and session time zone. DateTime values without zone information are stored in the database as system local time.

System local time offset is defined either using an SDF file and the tdlocaledef utility, or using the System TimeZone Hour and System TimeZone Minute DBS Control settings.

Default

2 for:
  • new Teradata systems.
  • systems that have been upgraded or re-initialized (sysinited) from prior database releases in which TimeDateWZControl had been 0 and System TimeZone Hour or System TimeZone Minute had been non-zero.
For systems that have been upgraded or sysinited from prior database releases in which TimeDateWZControl had been a non-zero value, that value remains unchanged after the upgrade or sysinit.

Changes Take Effect

After the DBS Control Record has been written.

Usage Notes

TimeDateWZControl must be enabled to use temporal tables. For more information on temporal tables, see Teradata Vantage™ - ANSI Temporal Table Support, B035-1186 and Teradata Vantage™ - Temporal Table Support, B035-1182.

The session time zone can be set in the following ways:
  • TIME ZONE parameter of the CREATE USER statement

    Sets the default time zone displacement from UTC used for sessions opened by the user.

  • SET TIME ZONE statement

    Sets the time zone displacement from UTC for the current session. Overrides the time zone defined for the current user.

If no session time zone is defined in either of these ways, the session time zone defaults to the database system time zone, as defined by the DBS Control fields System TimeZone Hour and System TimeZone Minute.

Examples: Using the TimeDateWZControl field of DBS Control

For the following examples, assume:
  • The time local to the database server is 11:59:00 Coordinated Universal Time (UTC), January 31, 2010.
  • User TK lives in Tokyo, and has a time zone defined as +9 hours offset from UTC.
  • User LA lives in Los Angeles, and has a time zone defined as -8 hours offset from UTC.
  • User TK and User LA run the CURRENT_TIMESTAMP function at exactly the same time.

When this field is enabled:

For User TK, the CURRENT_TIMESTAMP function returns:

2010-02-01 20:59:00.000000+09:00

For User LA, the CURRENT_TIMESTAMP function returns:

2010-01-31 03:59:00.000000-08:00

When this field is disabled:

For User TK, the CURRENT_TIMESTAMP function returns:

2010-01-31 11:59:00.000000+09:00

For User LA, the CURRENT_TIMESTAMP function returns:

2010-01-31 11:59:00.000000-08:00

CURRENT_TIME and CURRENT_DATE functions display analogous behavior.

Related Information

For more information on… See…
Teradata built-in time and date functions Teradata Vantage™ - SQL Date and Time Functions and Expressions, B035-1211.
Setting session time zones Information about SET TIME ZONE, CREATE USER, and MODIFY USER in Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.
DateTime, Interval, and Period data types Teradata Vantage™ - Data Types and Literals, B035-1143.
System TimeZone fields System TimeZone Hour and System TimeZone Minute.
Temporal tables Teradata Vantage™ - Temporal Table Support, B035-1182.