Thursday, March 22, 2012

Converting a date from one timezone to another timezone

Hi,
I have a requirement for a function which would convert a given date with a present timezone to a new timezone.

For eg : the function would be called lets say TZ

then I can issue the following select statement to get the new timezone

select getdate(), TZ(getdate(), PST, EST)

where PST is the current timezone and EST is the new timezone.

I know that ORACLE has a built in function to do this. Am just wondering if theres some function that I can use to accomplish the task.

Thanks
-soumilyou can write your own function using info from this site (http://wwp.greenwichmeantime.com/info/timezone.htm).|||This is a real pain-in-the-butt to do, not just because of all the time zones, but because even within a time-zone some areas may use Daylight Savings Time, and some may not.

I had to deal with this when I designed an EDI tracking application. In the end we decided it was best to always output the data in GMT and then let the webpage translate it to whatever local time the page was being viewed in. For incoming data, I required all events to include a time stamp from their point of origin, and then I added a local time stamp. By comparing the two values we were able to synchronize events across time-zones without even caring what zone they came from, and it accounted for discrepancies in system-clock times as well.

I hope you can use some work-around like this, or find someone who has already written the procedure/function for you.|||there is one already written by tara check it out:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=28712
harsh.

No comments:

Post a Comment