DB2 10.5 for Linux, UNIX, and Windows

GET_TIME function - Return the current time

The GET_TIME function provides the capability to return the current time in hundredths of a second.

Syntax

The value represents the number of hundredths of second since 1970-01-01-00:00:00.00000000000.

Read syntax diagramSkip visual syntax diagram
>>-DBMS_UTILITY.GET_TIME--(--)---------------------------------><

Authorization

EXECUTE privilege on the DBMS_UTILITY module.

Examples

Example 1: The following example shows calls to the GET_TIME function.
SELECT DBMS_UTILITY.GET_TIME FROM DUAL;

 get_time
---------
  1555860

SELECT DBMS_UTILITY.GET_TIME FROM DUAL;

 get_time
---------
  1556037
Example 2: The following example converts the value returned by the GET_TIME function into hours, minutes, and seconds (with no adjustment for timezone).
VALUES TIMESTAMP('1-1-1970') + (DBMS_UTILITY.GET_TIME() / 100) SECONDS

1                         
--------------------------
2012-11-22-19.23.14.000000