0

有一个字符串:

$time = "2013-07-10T21:00:00.000";

如何将其转换为“2013-07-10 21:00:00”格式?

4

3 回答 3

4
$time = strtotime("2013-07-10T21:00:00.000");
return strftime("%Y-%m-%d %H:%M:%S", $time);
于 2013-07-10T19:09:48.893 回答
1
$date = new \DateTime($time);
$date->format('Y-m-d H:i:s');
于 2013-07-10T19:11:38.853 回答
1
$time = "2013-07-10T21:00:00.000";
echo date("Y-i-d H:m:s",strtotime($time));
于 2013-07-10T19:12:09.707 回答