Q:

Write a Oracle SQL statement to get the current date in the specified session time zone

0

Write a Oracle SQL statement to get the current date in the specified session time zone.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Oracle Code:

ALTER SESSION SET TIME_ZONE = '-8:0';
ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';
SELECT SESSIONTIMEZONE, CURRENT_DATE FROM DUAL;
ALTER SESSION SET TIME_ZONE = '-9:0';
SELECT SESSIONTIMEZONE, CURRENT_DATE FROM DUAL;

Output:

  	SESSIONTIMEZONE	CURRENT_DATE
1	-08:00	2/24/2021 3:31:46 AM

  	SESSIONTIMEZONE	CURRENT_DATE
1	-09:00	2/24/2021 2:31:46 AM

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now