I have a date displaying in the following format mm-dd-yyyy, and i want to convert it to this format yyyy-mm-dd 00:00:00, where I dont have to define the last 6 zeros, how can i do this??
thanks
<?php $date = '12-15-2007'; $formatted = date('Y-m-d H:i:s', strtotime(str_replace('-', '/', $date))); echo $formatted;
I fixed it by myself, but thanks anyway 🙂
Don't forget to mark this thread resolved.