If you wish to format a date into a different format in PHP is very simple. All you need to do is look bellow. You can use the strtotime function to format a string date into timestamp. After that use the timestamp with date function to get the new format
$oldDate = "2010-03-21"; // year-month-day $newDate = date("d-m-Y", strtotime($originalDate)); //strtotime convers a string into a timestamp
If you wish to format the current time check this.
[…] If you do not wish to format the current time but a different time… just replace time() to the timestamp of that date. Here is an example of a specific date formatted date […]