Hello!! i want to save datetimes into a mysql database. Their format is dd-mm-yy hh:mm. I think mysql format for datetime is yy-mm-dd hh:mm..How can i convert them??
<?php // MySQL format $format_1 = date('Y-m-d H:i:s'); // Convert to new format $format_2 = date('d-m-Y H:i:s', strtotime($format_1)); // Convert back to MySQL format $format_3 = date('Y-m-d H:i:s', strtotime($format_2)); ?> PHP: