PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $date = '01.04.2022'; $date = '28-04-2022'; function convertDate5($date) { return date('Y-m-d', strtotime($date)); } function convertDate($date) { return substr($date, 6, 4) . '-' . substr($date, 3, 2) . '-' . substr($date, 0, 2); } print_r(convertDate($date)); echo "\n"; print_r(convertDate5($date));
Show:  
Copy Clear