[SOLVED] Problem displaying the date correctly when passed as parameter

I have two form application.
First form display a date called {visitdate} and display in the format of dd/mm/yyyy on the form. e.g 07/06/2012 (7 june 2012)

The call another form this form via a button (php code):
[vdate]={VisitDate};
sc_apl_conf(“form_housevisitdetail”, “start”, “new”);
sc_redir(form_housevisitdetail.php, VisitDate=[vdate], “_blank”);

On the second form:-
I perform a var_dump([vdate]) and it display 06072012
But when it is display on the form, the field VisitDate shows 12/20/0706 . The format is set at dd/mm/yyyy

How do we correct this? to display 07/06/2012

Re: Problem displaying the date correctly when passed as parameter

I managed to solve the problem by using the scriptcase macro:

{field_date} = sc_date_conv({field_date}, “ddmmaaaa”, “aaaammdd”);