Page 1 of 1

Converting from DB2 time to DS time

Posted: Thu Apr 19, 2007 10:11 am
by patonp
I'm receiving data in a db2 extract where the time is represented by an integer based on the number of milliseconds that have elapsed since midnight. I'd like to convert this to a standard time format (i.e. HH:MM:SS.TTT). I realize that I can write my own routine to do this, but I'm hoping that there might be some out-of-the-box functionality in DS that does the conversion for me.

Any suggestions?

BTW - although I've classified this as a Parallel job type, I'm open to options on either canvas...

Cheers,

Peter

Posted: Thu Apr 19, 2007 12:30 pm
by DSguru2B
Use TimeFromMidnightSeconds() function to get the time. But this function requires seconds since midnight and not milliseconds, so you will have to divide you will have to divide the number by 60 to get seconds. So you decide, can you live with getting time upto seconds or not.

Posted: Thu Apr 19, 2007 12:42 pm
by rafik2k
DSguru2B ,
Since Peter is already getting time in milliseconds,
I think he needs to multiply with it to get seconds, not divide.

Posted: Thu Apr 19, 2007 12:45 pm
by DSguru2B
Really, think again :wink:

Posted: Thu Apr 19, 2007 2:42 pm
by patonp
Thanks for the suggestion!