users with different timezone [message #278112] |
Thu, 01 November 2007 18:41 |
nil123
Messages: 6 Registered: November 2007
|
Junior Member |
|
|
Hi,
I've a need where I need to create users which have different time zone. so when that user logs in, he/she gets their local time, when they do select sysdate... Is it possible ?
I was thinking about creating logon trigger, and then user alter session set time_zone=.....
Any problem with that ?
OR
any other way to assign different time zone ?
Thanks
|
|
|
|
Re: users with different timezone [message #278119 is a reply to message #278113] |
Thu, 01 November 2007 21:15 |
nil123
Messages: 6 Registered: November 2007
|
Junior Member |
|
|
The current set up is in sql server for different countries with each one in different time zone. There is a need to record certain activity at actual time in their local time. Once we move all of them in to oracle ( one db ), it's timezone will be according to US.
Now, the existing code we have won't work ( e.g. sysdate - 1 )... because there are some time sensitive data. if we continue using the same code, we'll have different results then before because now sysdate-1 will return more/less no of records.
I know column type " with local timezone " but that would require changing a lot in many tables. so I was thinking of a simple solution where each country becomes a schema and has a different timezone. ( i think postgress has that feature )
Any ideas...
Thanks
|
|
|
|
Re: users with different timezone [message #278281 is a reply to message #278152] |
Fri, 02 November 2007 12:27 |
nil123
Messages: 6 Registered: November 2007
|
Junior Member |
|
|
Each country's data is visible to their users only, no mix up.
I was thinking setting up time_zone for each user is possible, so no need to change underlying application. but seems like no other way...
Thanks
|
|
|
|
Re: users with different timezone [message #278329 is a reply to message #278288] |
Sat, 03 November 2007 01:11 |
girish.rohini
Messages: 744 Registered: April 2005 Location: Delhi (India)
|
Senior Member |
|
|
As Michel pointed out.. no need to set local timezone on client.
SQL> SELECT SYSTIMESTAMP FROM dual; -- on Server
SYSTIMESTAMP
----------------------------------------------------------
03-NOV-07 11.36.56.127252 AM +05:30
SQL> SELECT CURRENT_TIMESTAMP FROM dual; -- on client.. my machine
CURRENT_TIMESTAMP
----------------------------------------------------------
03-NOV-07 02.07.18.342920 AM -04:00
SQL>
My System timezone: EDT
--Girish
[Updated on: Sat, 03 November 2007 01:12] Report message to a moderator
|
|
|