- print_r: documentation ( source)
- date_get_last_errors: documentation ( source)
- date_create_from_format: documentation ( source)
- date_format: documentation ( source)
<?php
// Try to create the datetime instance
if ($date = date_create_from_format('d_m_Y_H_i_s', '29_11_2016_5_00_15')) {
echo date_format($date, 'Y-m-d');
} else {
// It failed! Errors found, let's figure out what!
echo "<pre>";
print_r(date_get_last_errors());
echo "</pre>";
}