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!

Convert date time to client timezone

Navinth BakmeedeniyaJul 4 2018 — edited Nov 27 2018

Hello Experts,

I'm designing an application in which users from different parts of the world like to see the date time fields (stored in tables) in their local time zone.

After going through different material in google, I believe the first thing here is to store date time fields in UTC (GMT) time zone in tables.

Client sessions may be starting from different regions.

I've already seen the usage of FROM_TZ function for conversion purpose similar to below.

CAST((FROM_TZ(CAST(date_column AS TIMESTAMP),'+00:00') AT TIME ZONE 'US/Western') AS DATE)

Here, we need to explicitly state the client timezone.

Is there any other SQL/PLSQL functions that can convert time in UTC to local session timezone?

Especially, a way which Oracle finds the client timezone by looking at may be the session properties?

Thanks & Best Regards,

Navinth

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 3 2018
Added on Jul 4 2018
23 comments
3,999 views