Page 1 of 1

How to convert date foramts to other formats

Posted: Tue Jun 12, 2012 10:22 pm
by e1994264
Hi,
I am getting date fields actually text fileds with various formats MM/DD/YY and YY/MM/DD . I need convert them to DD/MM/YYYY.
Please can any body tell the functions need to be used in converting date format and check the date ISv alid

Re: How to convert date foramts to other formats

Posted: Tue Jun 12, 2012 11:41 pm
by zulfi123786
e1994264 wrote:I need convert them to DD/MM/YYYY.
What is your target, change of format only makes sense if your target is sequential file
e1994264 wrote:Please can any body tell the functions need to be used in converting date format and check the date ISv alid
There are no functions to change the format of date value that exists in text form. you need to take substrings and concatenate them to fit your requirement

ex - yyyy-mm-dd to DD/MM/YYYY

X[9,2]:'/':X[6,2]:'/':X[1,4]

Posted: Wed Jun 13, 2012 12:50 am
by ray.wurlod
Do you know, reliably, which format your source dates are in? For example is 08/08/08 a YY/MM/DD or a MM/DD/YY format?

If not, you're doomed.