How to convert 19/Sep/2014 to 2014-10-19

If you know the structure will be exactly like the above:

function convertDate($oldDate) {
    $months = array('Jan' => 1,'Feb' => 2,'Mar' => 3,'Apr' => 4, 'May' => 5, 'Jun' => 6, 'Jul' => 7, 'Aug' => 8, 'Sep' => 9, 'Oct' => 10, 'Nov' => 11, 'Dec' => 12);
    $temp = explode('/', $oldDate);
    return $temp[2] . '-' . $months[$temp[1]] . '-' . $temp[0];
}
commented: thanks.itz worked +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.