hi,
i need to convert a date in this format:
November 28, 2009
to a mysql date format:
2009-28-11
what's the best method to convert the date using php?>
thanks.
hi,
i need to convert a date in this format:
November 28, 2009
to a mysql date format:
2009-28-11
what's the best method to convert the date using php?>
thanks.
Improvised from: http://www.bigroom.co.uk/blog/dates-in-php-and-mysql
$mysqldate = date( 'Y-m-d', strtotime( $phpdate ) );
// Example:
$phpdate = 'November 20, 2009';
$mysqldate = date( 'Y-m-d', strtotime( $phpdate ) );
echo $mysqldate;
// output: 2009-11-20