SQL Language (MOSC)

MOSC Banner

What am I missing? Get unexpected result of a query

in SQL Language (MOSC) 3 commentsAnswered ✓

I would expect different results fro DIFF_0 and DIFF_1 (1 hour difference), but I am getting the same result (fractions of seconds not counted).

ALTER SESSION SET TIME_ZONE = '+1:0';

ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';

select sysdate from dual;

select current_timestamp from dual;

select current_timestamp at time zone 'UTC' from dual;

select (current_timestamp - sysdate) as diff_0 from dual;

select ((current_timestamp at time zone 'UTC') - sysdate) as diff_1 from dual;


This is the result in SQLcl:

SQL> ALTER SESSION SET TIME_ZONE = '+1:0';

Session geõndert.

SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center