Source Code:
(back to article)
<?php $date = "05/15/2020 5:36 PM"; //converts date and time to seconds $sec = strtotime($date); //converts seconds into a specific format $newdate = date("Y/d/m H:i", $sec); //Appends seconds with the time $newdate = $newdate . ":00"; // display converted date and time echo "New date time format is: " . $newDate; ?>
Result:
Report an issue