//mysql date now date("Y-m-d H:i:s"); //convert mysql to int $phpdate = strtotime( $mysqldate ); //and back $mysqldate = date( 'Y-m-d H:i:s', $phpdate );