Converting date format

Categories: code, php



I don’t know what its called, but here, we use dd-mm-yyyy, meanwhile in php you can’t convert that date into a unix timestamp using strtotime. So I have to convert it to a US date format (mm-dd-yyyy).

// Convert date format from dd-mm-yy to mm-dd-yy
function convert_date_format($date)
{
    return implode('-', array_reverse(split('/', $date)));
}

No Comments yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Security Code:

GimpStyle Theme design by Horacio Bella.