Date and time in 24 hours format
问题 I have a date in this format Fri, 15 Jan 2016 15:14:10 +0800 , and I want to display time like this 2016-01-15 15:14:10 . What I tried is: $test = 'Fri, 15 Jan 2016 15:14:10 +0800'; $t = date('Y-m-d G:i:s',strtotime($test)); echo $t; But it is displaying date in this format: 2016-01-15 7:14:10 , it should be 2016-01-15 15:14:10 . How can i do this? 回答1: Use H instead: $test = 'Fri, 15 Jan 2016 15:14:10 +0800'; $t = date('Y-m-d H:i:s',strtotime($test)); echo $t; H : 24-hour format of an hour