roscoeh23
asked on
Converting a Uk date to a mysql date
I have my dates in this format
DD/MM/YY
I need to convert it to mysql DATE Â YYYY-MM-DDformat and back again.
In the past I have done this manually but is there a built in function for PHP or MYSQL to do this?
R.
DD/MM/YY
I need to convert it to mysql DATE Â YYYY-MM-DDformat and back again.
In the past I have done this manually but is there a built in function for PHP or MYSQL to do this?
R.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
$sql = "UPDATE yourtable SET yourdatefield = '$mysql_date' WHERE ... ";
$sql = SELECT yourdatefield FROM yourtable WHERE ... ";
$uk_date = date("y/m/d", strtotime($mysql_date));