Them darn Dates
Posted: Tue Feb 04, 2003 6:42 am
Help, being so thick! But can’t sort it.
Want to rearrange a date inputted in ye old English:
dd/mm/yyyy
so that it goes into a mysql database as :
yyyy/mm/dd
this is my last attempt:
$Break ="/";
$DateArray = explode("/",$FirstDate);
$year = ($DateArray[2]);
$month = ($DateArray[1]);
$day = ($DateArray[0]);
$ReturnDate = ($year.$Break.$month.$Break.$day);
?><script> alert(<? print $ReturnDate ?>);</script> <?
The alert output is :
27.8194444444444444444444444443
I can only assume that it’s dividing each value. How can I get it to act as a puka sting and not an equation.
Thanks in advance.
Want to rearrange a date inputted in ye old English:
dd/mm/yyyy
so that it goes into a mysql database as :
yyyy/mm/dd
this is my last attempt:
$Break ="/";
$DateArray = explode("/",$FirstDate);
$year = ($DateArray[2]);
$month = ($DateArray[1]);
$day = ($DateArray[0]);
$ReturnDate = ($year.$Break.$month.$Break.$day);
?><script> alert(<? print $ReturnDate ?>);</script> <?
The alert output is :
27.8194444444444444444444444443
I can only assume that it’s dividing each value. How can I get it to act as a puka sting and not an equation.
Thanks in advance.