Monday, October 22, 2012

PHP Function to convert date from mm/dd/yyyy to yyyy-mm-dd

Here is a simple Function to convert date from  mm/dd/yyyy to yyyy-mm-dd.



function convert_date($date)
{
                        if($date=='')
                        return '';
                     else
                        $dateArray=explode('/',$date);

                        return "$dateArray[2]-$dateArray[0]-$dateArray[1]";
}

No comments:

Post a Comment

MS SQL : How to identify fragmentation in your indexes?

Almost all of us know what fragmentation in SQL indexes are and how it can affect the performance. For those who are new Index fragmentation...