Try OpenEdge Now
skip to main content
ABL Data Types Addenda
DATETIME and DATETIME-TZ data types : DATETIME-TZ data type
 

DATETIME-TZ data type

The DATETIME-TZ data type consists of three parts: an ABL date and time (as for DATETIME), and an integer representing the time zone offset from Coordinated Universal Time (UTC) in minutes.
ABL stores DATETIME-TZ data in UTC, along with the time zone offset of the DATETIME-TZ. This allows for indexing of datetime data based on absolute times. UTC is the current universal standard for time. Local time zone values are relative to UTC (for example, Eastern Standard Time is UTC–05:00). For example, if a DATETIME-TZ field is created in Bedford, MA (time zone offset UTC-05:00) on June 20, 2003 at 15:55, the value stored in the database is 6/20/03 at 20:55 (time converted to milliseconds) with a -5 hour (-300 minute) offset.
Many applications deal with data that spans time zones. The DATETIME-TZ data type is useful for dealing with datetime data in absolute time. Here are some examples of when you might use the DATETIME-TZ data type:
*An order entry application that accepts orders from around the world wants the order datetimes stored in UTC so that they index in absolute time.
*An ABL application communicating with a Web service that includes an XML Schema datetime in its interface can use DATETIME-TZ parameters to communicate in absolute time, and to preserve time zone information from the datetime data coming from the Web service.
*An ABL client/AppServer communication should also use DATETIME-TZ, since the client and the AppServer might be in different time zones. For DATETIME-TZ, the value represents an absolute date and time, and there is no data loss when passing parameters between sessions in different time zones.