Home » SQL & PL/SQL » SQL & PL/SQL » how to get the time in a perticular time zone
how to get the time in a perticular time zone [message #220625] Wed, 21 February 2007 07:47 Go to next message
karismapanda
Messages: 58
Registered: January 2007
Member
Hi,
I am working in India on a database.I want the database time to be displayed in Canada/Atlantic timezone.how to do it.
thanks,
karisma
Re: how to get the time in a perticular time zone [message #220641 is a reply to message #220625] Wed, 21 February 2007 08:29 Go to previous messageGo to next message
pmaupoil
Messages: 40
Registered: February 2007
Location: France
Member
The sys_extract_utc function converts the indian time to gmt and then the new_time function converts it to Canada/Atlantic timezone.

You can also find the list of all timezones in v$timezone_names.

select new_time(sys_extract_utc(current_timestamp), 'GMT','AST') from dual;
icon6.gif  Re: how to get the time in a perticular time zone [message #220648 is a reply to message #220641] Wed, 21 February 2007 08:37 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Put a to_char over that to get desired format.

By
Vamsi
PS: I have learnt a new thing today.
Re: how to get the time in a perticular time zone [message #220657 is a reply to message #220625] Wed, 21 February 2007 08:59 Go to previous messageGo to next message
karismapanda
Messages: 58
Registered: January 2007
Member
Hi,
this will convert only to the perticular time zone.
But i want to get the new time in that timezone when i will do a 'select sysdate from dual'.
Thanks
Re: how to get the time in a perticular time zone [message #220659 is a reply to message #220625] Wed, 21 February 2007 09:04 Go to previous messageGo to next message
pmaupoil
Messages: 40
Registered: February 2007
Location: France
Member
The question is different then...
You want to change your db time zone.
You can use the "alter database set time_zone" statement.
Re: how to get the time in a perticular time zone [message #220818 is a reply to message #220625] Thu, 22 February 2007 04:52 Go to previous message
karismapanda
Messages: 58
Registered: January 2007
Member
hi,
when i am changing the time zone using 'alter database set time_zone' command the database is altered but when i am selecting sysdate from dual getting the os time not the new time.
thanks
Previous Topic: difference between Performance Tuning & Optimization
Next Topic: i want 100 th record ..
Goto Forum:
  


Current Time: Fri Dec 02 12:13:16 CST 2016

Total time taken to generate the page: 0.09544 seconds