@ShinVe Post #3
Thanks for the suggestion, but using U only returns the unix timestamp itself, without microseconds given by the results of microtime(true).
keith tyler dot com ¶
DateTime does not support split seconds (microseconds or milliseconds etc.)
I don't know why this isn't documented.
The class constructor will accept them without complaint, but they are discarded.
There does not appear to be a way to take a string like "2012-07-08 11:14:15.638276" and store it in an objective form in a complete way.
So you cannot do date math on two strings such as:
<?php
$d1=new DateTime("2012-07-08 11:14:15.638276");
$d2=new DateTime("2012-07-08 11:14:15.889342");
$diff=$d2->diff($d1);
print_r( $diff ) ;
/* returns:
DateInterval Object
(
[y] => 0
[m] => 0
[d] => 0
[h] => 0
[i] => 0
[s] => 0
[invert] => 0
[days] => 0
)
Looks like you will have to use sprintf() to output the results from date() and microtime()
```
$time = microtime(true);
$dFormat = "l jS F, Y - H:i:s";
$mSecs = $time - floor($time);
$mSecs = substr($mSecs,1);