I was measuring some curl requests and I used microtime(true)
. The example output would be 3.1745569706
This is 3.1745569706
seconds. I want to convert that to a somewhat more readable format, let's say 00:00:03:17455
(HOURS:MINUTES:SECONDS:MILLISECONDS)
$maxWaitTime = '3.1745569706';
echo gmdate("H:i:s.u", $maxWaitTime);
// which returns
00:00:01.000000
echo date("H:i:s.u" , $maxWaitTime)
// which returns
18:00:01.000000
That looks wrong. I'm not quite sure what I'm missing here.
How do I convert microtime() to HH:MM:SS:UU ?