How to calculate the difference in seconds b/w 2 timestams?

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mayank007
Participant
Posts: 8
Joined: Thu Sep 30, 2004 5:16 pm
Location: California

How to calculate the difference in seconds b/w 2 timestams?

Post by mayank007 »

Hi,

I need to compute the difference between 2 timestamps and store the results in "seconds" in the target table. This field is a duration field and so the timestamp be for the same day. How do i implement this. Can this be done using iconv and oconv functions?

Thanks,
Mayank :?
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Do a search this has been covered a lot. Ray posted several routines. If you cannot find it then let us know.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I was digging around in my Favorites to help on a different topic and stumbled across this post. The KBA version. Thought I would save you some searching. :wink:

So there's three tips in one here:

1) The answer to your question.
2) The fact that with almost 35,000 posts here, most questions have been asked and answered before.
3) That you have the ability to save things you'd like to refer to again in your Favorites list.

Enjoy!
-craig

"You can never have too many knives" -- Logan Nine Fingers
mayank007
Participant
Posts: 8
Joined: Thu Sep 30, 2004 5:16 pm
Location: California

Thanks

Post by mayank007 »

Hey ,

thanks a lot. I will try out this routine tomorrow. I guess this should solve my problem.

Mayank :D
Post Reply