Php 转换2015-12-0417:02:10+;00:00时间到微秒

Php 转换2015-12-0417:02:10+;00:00时间到微秒,php,time,Php,Time,我有一个2015-12-0417:02:10+00:00格式的时间字符串 我想将此字符串转换为mircoseconds decimal(16,4)like1449825379.3464 如何在PHP中转换?我尝试了以下方法: echo strtotime("2015-12-04 17:02:10 +00:00"); 但是它只返回1449248530,没有微秒。您可以这样做,但应该在日期字符串中提供毫秒 <?php $date = new DateTime('2015-12-04 17:0

我有一个
2015-12-0417:02:10+00:00
格式的时间字符串

我想将此字符串转换为
mircoseconds decimal(16,4)
like
1449825379.3464

如何在PHP中转换?我尝试了以下方法:

echo strtotime("2015-12-04 17:02:10 +00:00");

但是它只返回
1449248530
,没有微秒。

您可以这样做,但应该在日期字符串中提供毫秒

<?php
$date = new DateTime('2015-12-04 17:02:10.4418 +00:00');
$microseconds = (float) $date->format('U.u');
echo $microseconds; //prints 1449248530.4418

你试过什么吗?[注意:Stack Overflow不是教练中心。]我试过echo Strotime(“2015-12-04 17:02:10+00:00”);它返回1449248530