util.Datetime.getCurrentAsUTC

Returns the current date/time in UTC.

Syntax

util.Datetime.getCurrentAsUTC( )
  RETURNING utc DATETIME YEAR TO FRACTION(5)
  1. utc is the datetime value in UTC, with the precision DATETIME YEAR TO FRACTION(5).

Usage

The util.Datetime.getCurrentAsUTC() method returns the current system date/time in UTC (Universal Time ).

This method is provided to solve the daylight saving time transition issue of the util.Datetime.toUTC() method.

Note: The precision of the value returned by this method is a DATETIME YEAR TO FRACTION(5). Note that this precision is different from the default CURRENT precision when no qualifiers are specified.

Example

IMPORT util
MAIN
    DEFINE utc DATETIME YEAR TO FRACTION(5)
    LET utc = util.Datetime.getCurrentAsUTC( )
    DISPLAY "Current UTC: ", utc
END MAIN