TimeStamp Type

A TimeStamp primitive type is used to store the variable as type timestamp; that is, the date and time. If you declare a variable of type TimeStamp in your method that is referenced within the code of the method, it is initialized with the current date and time each time the method is invoked. If such a local variable is declared but is not referenced in the code, its value is not initialized.

In JADE thin client mode, local variables of type TimeStamp are always initialized to the date and time relative to the presentation client.

The following example shows the use of the TimeStamp primitive type.

vars
    timeStamp : TimeStamp;
    time      : Time;
    h,m,s,ms  : Integer;
begin
    h := 15;
    m := 39;
    s := 06;
    time.setTime(h, m, s, ms);
    timeStamp.setTime(time);      // Assigns format to string
    write timeStamp;              // Outputs 11 August 2000 3:39pm
end;

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

Expression Expression Type
timestamp-expression + time-expression (timestamp)
timestamp-expression - time-expression (timestamp)
timestamp-expression + timestampinterval-expression (timestamp)
timestamp-expression - timestampinterval-expression (timestamp)

The TimeStamp value that results from adding to a timestamp value or subtracting from a timestamp value does not take daylight saving into account.

For details about the constant and methods defined in the TimeStamp primitive type, see "TimeStamp Constant" and "TimeStamp Methods", in the following subsections. For details about converting primitive types, see "Converting Primitive Types", in Chapter 1 of the JADE Developer’s Reference.