adjust date format in C/AL

leon1983leon1983 Member Posts: 20
here is the problem, for once it is simple !!!


I have to enter a date from a file into the date field of one of my tables.




In my file the date is under this format : "2007-07-12"



Now I see that to insert a date in a table it must be in this format : "07/12/07"


Is there a function that exists in C/AL to convert "YYYY-MM-DD" in "MM/DD/YY"?


Otherwise if I have to code it manually, what are the functions to cut and concatenate a string?



thanks a lot ! :P :P :P

Comments

  • ara3nara3n Member Posts: 9,256
    mytext := '2007-07-12';

    evaluate(mydate,copystr(mytext,6,2)+copystr(mytext,9,2)+copystr(mytext,1,4));
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • leon1983leon1983 Member Posts: 20
    you rock....


    thank you :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P :P
Sign In or Register to comment.