Reputation: 105
I would like to get the actual date + time, and convert it (the time) to a 24 hour format (e.g: 15/04/2017 13:32:02
)
My current code is :
date_default_timezone_set("Asia/Magadan");
$date = date("d/m/Y h:i:s");
echo $date;
That display :
15/04/2017 01:32:02
Thanks.
Upvotes: 2
Views: 6509
Reputation: 105
Finally, to change to a 24 hour format we only have to change the H of the hour to a MAJ/CAPS.
$date = date("d/m/Y H:i:s");
http://php.net/manual/en/function.date.php
Upvotes: 1