CURRENT_DATETIME/CURRENT_DATETIME()/NOW()/SYS_DATETIME/SYSDATETIME

Description

CURRENT_DATETIME, CURRENT_DATETIME(), NOW() SYS_DATETIME, and SYSDATETIME are used interchangeably, and they return the current date and time in DATETIME type. The unit is millisecond.

Syntax

CURRENT_DATETIME

CURRENT_DATETIME()

NOW()

SYS_DATETIME

SYSDATETIME

Example

--it returns the current date and time in DATETIME type

SELECT NOW(), SYS_DATETIME;

 

   SYS_DATETIME                   SYS_DATETIME

==============================================================

  04:08:09.829 PM 02/04/2010     04:08:09.829 PM 02/04/2010

 

--it returns the timestamp value 1 hour added to the current sys_datetime value

SELECT TO_CHAR(SYSDATETIME+3600*1000, 'YYYY-MM-DD HH:MI');

  to_char( SYS_DATETIME +3600*1000, 'YYYY-MM-DD HH:MI', 'en_US')

======================

  '2010-02-04 04:08'