Hello,
I run this query on Oracle 11gR2:
SELECT SYSTIMESTAMP A, EXTRACT(HOUR FROM SYSTIMESTAMP) B, TO_CHAR(SYSTIMESTAMP,'HH24') C
FROM DUAL;
The result (per column):
A: 27-JUL-12 11.00.11.619332 PM +03:00
B: 20
C: 23
It seems that extract(hour from systimestamp) is subtracting the time zone offset (3 hours in my system) from the time and returns the result. On the other hand, to_char() does not perform such operation.
Could you confirm that my observation is correct?
Also, is this documented?
Regards,
Apostolis