Convert from MySQL datetime to another format with PHP
If you’re looking for a way to normalize a date into MySQL format, use the following The line $phpdate = strtotime( $mysqldate ) accepts a string and performs a series of heuristics to turn that string into a unix timestamp. The line $mysqldate = date( ‘Y-m-d H:i:s’, $phpdate ) uses that timestamp and PHP’s date … Read more