Source Code:
(back to article)
<?php // Create a new DateTime object using a string $date = new DateTime('2022-11-15 12:30:00'); // Format the DateTime object as a string echo $date->format('Y-m-d H:i:s'); // Output: 2022-11-15 12:30:00 ?>
Result:
Report an issue