Yes there is, but you dont have to format it in PHP. You can format it straight in your SELECT statement.
example:
SELECT DATE_FORMAT(datefield, '%d-%m-%Y %H:%i:%s') as date FROM table
If you want to know more about mySQL's date and time functions, check here.