cancel
Showing results for 
Search instead for 
Did you mean: 

Converting / transforming one time format to another

Former Member
0 Kudos

Hi Experts,

i want to contvert time in format ex. 10:30:00 to a format without colon i.e 103000. I tryed using Date Trans funinon by giving source as HH:mm:ss as source and target as: HHmmss. when tryed and tested li i am getting error: "Runtime exception during processing target field mapping"

i am getting only time to the XI box not the date.

Thanks,

Siva

Accepted Solutions (0)

Answers (4)

Answers (4)

Shabarish_Nair
Active Contributor
0 Kudos

You wouldnt need to write any UDF. If you are facing the issue with the date trans function, then better go with the replaceString standard function.

thats much more easier if all u have to do is to replace HH:MM:SS to HHMMSS.

Former Member
0 Kudos

Hi Dhanush,

Your configuration is correct. Did perform a right-click 'display queue' on the target field or on the transformData block? Please be aware that using another JAVA version than 1.4.2 can result in such unpredicted errors.

wilsonrsantos
Active Participant
0 Kudos

Hi Siva !

This sounds very estrange to me, the formats that you specified is correct. The only situation that I know that TransformDate generates error(considering that the formats are correct, as I think that is your case), is when the source field is empty.

Well, a single way to solve your need, and avoid the error that I mentioned above(when the source field is empty), is to use the replaceString function to replace colon(':') with empty(''), so, 10:10:00 will lead to 101000. I used this solution several times.

I hope this helps !

Best regards,

Wilson

Edited by: Wilson Santos on Jul 10, 2008 9:23 PM

Former Member
0 Kudos

Hey

Could you please upload a picture of how you are using the DateTrans function.

to me it looks like there is some issue in the way you have given the transformation.

Thanx

Aamir

Former Member
0 Kudos

This message was moderated.