Timstamp Function (Transformer)

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
vick
Participant
Posts: 88
Joined: Sun Oct 30, 2005 2:06 am

Timstamp Function (Transformer)

Post by vick »

Hi

I need to update a column in database with current timestamp offset "X" number of hours (in short Current timestamp minus 7 hours).

I have a job that looks like this

Code: Select all

ROW_GEN--------------> TFR------------->ORACLE_ENT
I m passing the offset hours as a paramter (string). I convert this string value to unix time (in seconds) using "TimetFromTimestamp" function in Transformer.

I also convert my Current Timestamp() into unix time using "TimetFromTimestamp" function. I then subtract both and convert the unix time t to timestamp using "TimestampFromTimet" .

For instance if I have offset as 2 hours and current timestamp is
2007-08-17-12.00.00 then I should get 2007-08-17-10.00.00.

But I get 2007-08-17-09.00.00, that is if I pass 2 hours as offset I get 3 hours off.

Any pointers. Is there an another way to do this?
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Quick fix? Minus one.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
Post Reply