Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

EXTRACT(HOUR from SYSTIMESTAMP)

ApostolisJul 27 2012 — edited Jul 27 2012
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 24 2012
Added on Jul 27 2012
16 comments
45,574 views