24 hour format for the actual time?
问题 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. 回答1: Put the h capital for 24 hour format date("d/m/Y H:i:s"); 回答2: 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