How do you convert " 000125" (YYMMDD date format) to 01/25/2000 instead of 01/25/1900. I am currently using Visual FoxPro 5. <br>
<br>
Thanks,<br>
<br>
Ken<br>
<br>
There are several ways to do this, each giving you what you want. In the example below, I chose not to assume the current century, but rather take it from the current date:<br>
<br>
x = "000125"<br>
cAnswer = substr(x,3,2) + "/" + substr(x,5,2)+ "/" + left(dtos(date()),2) + left(x,2)<br>
<br>
or, to get a date type:<br>
<br>
dAnswer = ctod(substr(x,3,2) + "/" + substr(x,5,2)+ "/" + left(dtos(date()),2) + left(x,2))<br>
<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.