Useful when converting between those two formats often:
function formatDateMysql($timestamp = false) { if ($timestamp === false) { $timestamp = time(); } return date('Y-m-d H:i:s', $timestamp); }
in the other direction you can use the mighty strtotime function, o god I love PHP so much <3
(Yes Java, your Date object is a mess!)