GetCommitTimeAsString

Returns the string of the time used for the history timestamp when the action is committed.

The CQEntity::GetCommitTime and CQEntity::GetCommitTimeAsString methods work together. The return value of these APIs is the time used for the history timestamp when the action is committed. This time is obtained from the database server, thereby avoiding issues related to variations in the clocks on client machines. The only difference between the two APIs is the type of the return value and that the string form can optionally be represented as local or GMT, and optionally with a time zone suffix.

These APIs can be used only during an action's validation, commit, or notification phases. If called at any other time, an exception will be thrown.

The value returned by these APIs is constant for the duration of the action. The first time either one is called during the validation or later phase of an action, the current time is obtained from the database server and stored in memory with the entity. Any subsequent calls will return that same value until the action is complete. If validation fails, the value will be cleared such that the next time either API is called during a validation or later action phase, and a new value will be obtained from the database server and returned.

Syntax

Perl

$entity->GetCommitTimeAsString(const BOOL asGMT,
const BOOL withTZ);
Identifier
Description
entity

An Entity object.

asGMT

A boolean value that specifies whether the result should be local or GMT. When true, the result will be GMT. When false, it will be local time.

withTZ
A boolean value that specifies whether the result should include a numeric time zone suffix. When true, the return value will include a '+' or '-' and a hour offset. When false, the return value will not have a time zone suffix.
Return value
A String that contains the time used for the history timestamp when the action is committed. This time is obtained from the database server, thereby avoiding issues related to variations in the clocks on client machines.