Create a date from its parts

I have three variables $y, $m, $d. (year, month, day)

I need to update a date field {myDate}
{myDate} =$m."/".$d."/".$y;

but I get the wrong result

if I set $X =$m."/".$d."/".$y; and then print $X it is correct. It is just not apparently a valid date variable

Anyone know how?