SQL Tutorial SQL Advanced SQL Database SQL References

Oracle SYSTIMESTAMP Function



The Oracle (PL/SQL) SYSTIMESTAMP function returns the system date, including fractional seconds and time zone, of the system on which the database resides. The return type is TIMESTAMP WITH TIME ZONE.

Syntax

SYSTIMESTAMP

Parameters

No parameter is required.

Return Value

Returns the current date and time set for the operating system on which the database resides.

Example 1:

The example below shows the usage of SYSTIMESTAMP function.

SYSTIMESTAMP
Result: '27-DEC-2021 05:11:57.718988 AM +00:00'

Example 2:

Consider a database table called EmployeeLogin with the following records:

EmpIDNameLogin Stamp
1John25-OCT-2019 09:20:38.276815 AM +00:00
2Marry25-OCT-2019 09:21:05.123456 AM +00:00
3Jo25-OCT-2019 09:24:35.654321 AM +00:00
4Kim25-OCT-2019 09:25:24.122433 AM +00:00
5Ramesh25-OCT-2019 09:27:16.556711 AM +00:00

To insert a new record in this table, the following statement can be used.

INSERT INTO EmployeeLogin 
VALUES (6, 'Suresh', SYSTIMESTAMP);

-- see the result
SELECT * FROM EmployeeLogin;

This will produce a result similar to:

EmpIDNameLogin Stamp
1John25-OCT-2019 09:20:38.276815 AM +00:00
2Marry25-OCT-2019 09:21:05.123456 AM +00:00
3Jo25-OCT-2019 09:24:35.654321 AM +00:00
4Kim25-OCT-2019 09:25:24.122433 AM +00:00
5Ramesh25-OCT-2019 09:27:16.556711 AM +00:00
6Suresh25-OCT-2019 09:28:19.298518 AM +00:00

❮ Oracle Functions