Skip to Main Content

Oracle Database Discussions

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!

FROM_TZ vs cast ... at time zone

aroferJan 20 2015 — edited Jan 26 2015

I don't understand why these two values are different:

select cast( LOCALTIMESTAMP  as timestamp with time zone) at time zone  'Canada/Eastern'

, from_tz( LOCALTIMESTAMP ,'Canada/Eastern'  )

from dual;

Note: time here in California is 02:33 PM.

Answer is:

20-JAN-15 05.33.44.855614000 PM CANADA/EASTERN    20-JAN-15 02.33.44.855614000 PM CANADA/EASTERN

I thought these two operations were roughly equivalent.

Can someone explain why the from_tz returns a local time value and cast ... at time zone returns the specified time zone time?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 23 2015
Added on Jan 20 2015
7 comments
2,947 views