<?php function convertStringToDate ($date) { $time = strtotime($date); $new_date = date('Y-m-d',$time); return $new_date; }