The Oracle CURRENT_TIMESTAMP function will display the current date and time in the session time zone.
Just like the CURRENT_DATE function, it uses the session time zone, which is where you logged in from. This could be different to the database time zone.
The syntax of the CURRENT_TIMESTAMP function is:
CURRENT_TIMESTAMP ( [precision] )
The return type of this function is TIMESTAMP WITH TIME ZONE.
The precision parameter is optional, and it lets you specify the number of fractional seconds to return. If this is omitted, it uses the default of 6.
It’s different to the SYSTIMESTAMP function, because CURRENT_TIMESTAMP returns the session timezone, and SYSTIMESTAMP returns the database time zone. So, if I’m logging in from Melbourne, Australia, and the database is in London, England, then the CURRENT_TIMESTAMP will return a date and time that’s 10 hours ahead of SYSTIMESTAMP, and in a different time zone. It may be on the same day, or it could be a different day, depending on when I run the function.
You can perform arithmetic on this function just like any other date value (e.g. CURRENT_TIMESTAMP - 7 for 7 days ago). However, it might be better to use interval data types so you can keep the original data type.
For more information about the Oracle CURRENT_TIMESTAMP function, including all of the SQL shown in this video and the examples, read the related article here: