DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

PHP Function For Converting UK Dd/mm/yyyy Format Into Yyyy-mm-dd Format For Inserting Into Mysql

  • submit to reddit
        // description of your code here
Convert Mysql Date
I am Using the following function to convert mysql date format into my req.

function uk_date_to_mysql_date($date){
$date=date("Y-m-d", mktime(0,0,0,$date_month,$date_day,$date_year));
return $date; 

echo uk_date_to_mysql_date($row['date']); //// $row['date'] is in the form :yyyy-mm-dd.