Specifies the time zone offset from UTC, in
minutes, to use for the current session.
Data type: INTEGER
Access: Readable/Writeable
Applies
to:
SESSION system handle
The AVM uses the TIMEZONE value to calculate the results of:
- the functions DATETIME-TZ, MTIME, NOW, TIME, TIMEZONE, and TODAY
- direct assignment operations between DATE, DATETIME, and DATETIME-TZ
data types
- the special TODAY and NOW initial values for database and temp-table fields with DATE,
DATETIME, and DATETIME-TZ data types.
For example, the following code shows how TIMEZONE Is used in a direct
assignment of a DATE value to a DATETIME-TZ value:
DEFINE VARIABLE dDate AS DATE NO-UNDO.
DEFINE VARIABLE tzDate AS DATETIME-TZ NO-UNDO.
dDate = 1/25.
tzDate = dDate.
DISPLAY tzDate.
|
Because the DATETIME-TZ data type contains more information than a DATE
data type, the time value of
tzDate defaults to midnight.
If SESSION:TIMEZONE is not set, the timezone defaults to the session's timezone, and the
code displays:
01/25/2016 00:00:00.000-5:00
|
However, if SESSION:TIMEZONE is set to 120, the timezone is offset from UTC by two
hours, and the code displays:
01/25/2016 07:00:00.000+2:00
|
For more information on assignments with time data types, see the ASSIGN statement.
Notes
- For releases 11.6.0 and earlier, TIMEZONE only affected the MTIME, NOW,
TIME, TIMEZONE, and TODAY functions. TIMEZONE was not applied to the DATETIME-TZ function
and direct assignments. You can revert to the behavior of earlier releases by specifying
the -useSessionTZ 0 parameter. See OpenEdge Deployment: Startup Command and Parameter for more
information on -useSessionTZ.