I am using oracle apex when ever I try the code
SELECT TO_CHAR (SYSTIMESTAMP) "NOW" FROM DUAL
The result is always behind 5 hours. Can any one help me for this query?
I am using oracle apex when ever I try the code
SELECT TO_CHAR (SYSTIMESTAMP) "NOW" FROM DUAL
The result is always behind 5 hours. Can any one help me for this query?
To get the time on the database server:
SELECT SYSTIMESTAMP FROM DUAL
Or, if you want to format it as a string:
SELECT TO_CHAR(SYSTIMESTAMP, 'YYYY-MM-DD HH24:MI:SS.FF TZH:TZM')
FROM DUAL;
If you want the time on the client then:
SELECT CURRENT_TIMESTAMP FROM DUAL;
or, you can take the system time and convert it to local time:
SELECT SYSTIMESTAMP AT LOCAL FROM DUAL;
(Or you can format either as a string by wrapping it in TO_CHAR
)
Note: when you state "The result is always behind 5 hours", you need to make sure you also compare time zones.
db<>fiddle here