Product Information > JADE Encyclopaedia of Primitive Types > Chapter 1 - Primitive Types > TimeStampOffset Type

TimeStampOffset Type

The TimeStampOffset primitive type is used to represent a Coordinated Universal Time (UTC) date and time value, together with an offset that indicates how much that value differs from the local time when the value was set. The value of the offset component is precise to the minute.

A TimeStampOffset value unambiguously identifies a single point in time.

If you declare a TimeStampOffset primitive type local variable in your method, it is initialized with the current date, time, and offset from UTC each time the method that declares the variable is invoked. The offset is that of the presentation client if running in thin client mode; otherwise, it is the offset of the node where the code is executing.

The following example shows the initialization of a local TimeStampOffset variable.

vars
    tso : TimeStampOffset;
    ts : TimeStamp;
begin
//  Executed in New Zealand, which is 13 hours 'ahead of Greenwich' in summer
    write ts;     // outputs 20 January 2009, 09:15:20
                  // (current date and time in New Zealand)
    write tso;    // outputs 19 January 2009, 20:15:20 +1300
                  // (current date and time in Greenwich)
end;

Object attributes of type TimeStampOffset are initialized with a null date, null time, and null offset; that is, 00:00:00 +0000.

The following table lists valid operations for the TimeStampOffset primitive type.

Expression Expression Type
timestampoffset-expression + time-expression (timestampoffset)
timestampoffset-expression - time-expression (timestampoffset)
timestampoffset-expression + timestampinterval-expression (timestampoffset)
timestampoffset-expression - timestampinterval-expression (timestampoffset)
timestampoffset-expression - timestampoffset-expression (timestampinterval)
timestampoffset -expression < or <= or = or >= or > or <> timestampoffset -expression (boolean)

For details about the methods defined in the TimeStampInterval primitive type, see "TimeStampOffset Methods", in the following subsection. For details about converting primitive types, see "Converting Primitive Types", in Chapter 1 of the JADE Developer’s Reference.