How to convert GMT to EST

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

How to convert GMT to EST

Post by dodda »

HI,

I have a source table in which the date is stored in GMT format. I need to convert the GMT format date to EST format(for some months i have to substract 4 hours and for other i have to substract 5 becuase of the day light savings). How can i do it in DS? Please advice .....
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

Many databases have this inbuilt feature. You can better handle this with database than i datastage

Regards
Sreeni
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's not a simple problem to solve properly, hence the suggestion to leverage something else that already does that rather than roll your own solution. You could also do an exact search here for "daylight savings" and see what kind of answers other people got when they had a similar requirement.
-craig

"You can never have too many knives" -- Logan Nine Fingers
udayk_2007
Participant
Posts: 72
Joined: Wed Dec 12, 2007 2:29 am

Post by udayk_2007 »

If you are using Oracle as database,there is a in built function new_time which does the same function

e.g select new_time('15-Mar-09 14:35:00','GMT','EST) from dual;
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Post by dodda »

My base table is an SQL Server ... I need to read it from the SQL Server database ....
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There should be an OFFSET column in your time dimension table.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sajidkp
Participant
Posts: 114
Joined: Thu Apr 30, 2009 12:17 am
Location: New Delhi

Post by sajidkp »

The Mannual approach would be,

Save the day light saving intervel in a table. Then while extracting from soucre (GMT time) make a look up with this table , then if your daytime fall in the daylight saving intervel then add/substract 4hrs/5hrs else add/substract accordingly. Let me know if this is possible in your case
Regards,
Sajid KP
Post Reply