GetTimeStamp Function

Action

Returns the number of seconds or milliseconds elapsed since midnight (00:00:00), January 1, 1970 likewise as GMT or local time.

Include file

Kernel.bdh

Syntax

GetTimeStamp( in nFlags : number ): string;

Return value

String representation of the number of seconds or milliseconds.

Parameter Description
nFlags

Several combination of the following options are possible.

  • TIMESTAMP_GMT. Return GMT time.

  • TIMESTAMP_LOCAL. Return local time.

  • TIMESTAMP_IN_MS. Return time in milliseconds.

  • TIMESTAMP_IN_SEC. Return time in seconds.

  • TIMESTAMP_IN_HEX_LOWER. Return value in lowercase Hex. (for example: 0x0a)

  • TIMESTAMP_IN_HEX_UPPER. Return value in uppercase Hex. (for example: 0Ah)

Example

dcltrans
  transaction TRaiseError
  begin
    write(GetTimeStamp(TIMESTAMP_GMT | TIMESTAMP_IN_MS));
  end TRaiseError;