SetToNow Method (DATETIME)


10.3A, PLBCMP GUI Only

 

The SetToNow method sets the value of the DATETIME object. The method uses the following format:

 

[label]

{object}.SetToNow

[GIVING {return}] USING [*LocalTime=]{localtime}

 

Where:

label

Optional. A Program Execution Label.

object

Required. A DATETIME object that has previously been declared.

return

Optional. A Numeric Variable that returns an error value if this method fails.

localtime

Optional. A Numeric Variable or decimal number that specifies if the DATETIME value should be set to local time or UTC.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. The DATETIME object is set to the current time.

  2. If the {localtime} is set to one (1), the DATETIME value is set as local time. If the {localtime} is set to zero (0) the DATETIME value is set as UTC. If the {localtime} is not given, the DATETIME value is set as UTC.

  3. The ZERO flag is set with a return value of zero. When ZERO flag is cleared, a non-zero value indicates an error has occurred and the error values are found in the DATETIME object notes.

  4. The OVER flag is set if the {return} variable is too small to store that value without being truncated.

  5. The EOS flag is always cleared.

 

 

See Also: Method Syntax, DATETIME Methods

 



PL/B Language Reference SetToDateTime Method (DATETIME)