Date Time manipulation

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
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Date Time manipulation

Post by mydsworld »

I have in my input fields such as Update Date and Time. I would like to add 6 hrs 30 min to that to get a new date and time. How to do the transformation.
Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Convert dates to Julian dates. Convert times to seconds from midnight. Do the arithmetic. Convert back to date/time/timestamp.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mfavero
Premium Member
Premium Member
Posts: 45
Joined: Thu Jan 16, 2003 1:20 pm
Location: Minneapolis

Post by mfavero »

Sometimes Ray isn't too gentle with simple questions. You should really read the Parallel Job Developer Guide. But in this as in many instances the answers are not particularly apparent. Try page 606 under date and time functions. Convert 6 hours 30 min to seconds and use

TimestampFromSecondsSince function

Returns the timestamp from the number of seconds from the base timestamp

args: seconds (dfloat), [base timestamp]
output: timestamp

:twisted:
Michael Favero

2852 Humboldt Ave So
Minneapolis, MN 55408
bollinenik
Participant
Posts: 111
Joined: Thu Jun 01, 2006 5:12 am
Location: Detroit

Post by bollinenik »

Hi,
Create a routine and call that to do the caluculation and change into required format.
Post Reply