SET SESSION TIME ZONE statement
The SET SESSION TIME ZONE statement assigns a value to the SESSION TIME ZONE special register.
Invocation for SET SESSION TIME ZONE
This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.
Authorization for SET SESSION TIME ZONE
None required.
Syntax for SET SESSION TIME ZONE
Description for SET SESSION TIME ZONE
- string-constant
- Identifies a time zone with a value of the form '±th:tm' , where th represents the time zone hour between -12 and +14, and tm represents the time zone minutes in the range 0–59, with values ranging from -12:59 to +14:00.
- variable
- Specifies a variable that contains a time zone. The variable must be a CHAR or VARCHAR variable that is not followed by an indicator variable. The variable must not be the null value. The value must be left justified and be of the form '±th:tm' , where th represents the time zone hour between -12 and +14, and tm represents the time zone minutes in the range 0–59, with values ranging from -12:59 to +14:00.
Notes for SET SESSION TIME ZONE
- Impact on other special registers:
- Setting the SESSION TIME ZONE special register does not affect the CURRENT TIMEZONE special register.
- Syntax alternatives:
- SESSIONTIMEZONE can be specified as an alternative to SESSION TIME ZONE or TIME ZONE.
Example for SET SESSION TIME ZONE
Set the SESSION TIME ZONE as -8:00:
SET SESSION TIME ZONE = '-8:00';