Page 1 of 1

Date conversion

Posted: Mon Apr 07, 2008 10:25 am
by rajkraj
Hi ,

I have a String coming in as mm/dd/yy i.e 04/15/06 now i want to convert this string into another string of fotmat YYYYMMDD i.e 20060415.
I am using a transformer stage to do the conversion.

i tried doing StringToDate, it is giving the output as 1906-04-15.
How do i get output as 20060415.

Thanks

Posted: Mon Apr 07, 2008 10:55 am
by tomk
Try using the following format when converting from a string to a date:
%mm/%dd/%2000yy

This will translate any yy on the input to 20yy.

When translating back to a string (for output), use the following format:
%yyyy%mm%dd

Posted: Mon Apr 07, 2008 11:33 am
by rajkraj
Thanks Tom,that gave the desired result.Thank you.