显示从strtotime开始的时间,不显示上午或下午


display the time from strtotime without showind am or pm

嗨,在我的php网站上,我需要以24小时系统显示时间。即不在上午/下午。我有一个日期03/17/2012 9:40 PM,我想将其显示为

17-03-2012 21:40 

php中有什么功能可以实现这一点吗?我搜索了很多,但都失败了
提前感谢

试用strftime():

echo strftime("%d-%m-%Y %H:%M");
$time_in_24_hour_format  = date("m/d/Y H:i", strtotime("03/17/2012 9:40 PM"));
$date = "03/17/2012 9:40 PM";
$time = strtotime($date);
$new_date = date('d-m-Y H:i', $time);
echo $new_date; // results in 17-03-2012 21:40

这可能行得通,不是吗?