NOW

The NOW function returns a timestamp based on a reading of the time-of-day clock when the SQL statement is executed at the current server. The value returned by the NOW function is the same as the value returned by the CURRENT_TIMESTAMP special register. If this function is used more than once within a single SQL statement, or used with the CURDATE or CURTIME scalar functions or the CURRENT_DATE, CURRENT_TIME, or CURRENT_TIMESTAMP special registers within a single statement, all values are based on a single clock reading.

Read syntax diagramSkip visual syntax diagram
>>-NOW--(--)---------------------------------------------------><

The data type of the result is a timestamp. The result cannot be null.

Note

Syntax alternatives: The CURRENT_TIMESTAMP special register should be used for maximal portability. For more information, see Special registers.

Example

  • Return the current timestamp based on the time-of-day clock.
      SELECT NOW()
        FROM SYSIBM.SYSDUMMY1