Jump to content

Problems with microtime() and Date() Functions


objnoob

Recommended Posts

I'm using microtime to capture $start_time and $finish_time bothing using microtime() function. I then pass both $start_time and $finish_time into date() function to parse a date. The difference between $start_time and $finish_time is also calculated. The problem being the date() function is producing incorrect values.

 

list($total_count, $success_count, $errors_data, $start_time, $finish_time)	= $summary_data;
$duration_time = $finish_time - $start_time;

echo "<b>Started Processing At:</b> ".date('m/d/Y H:i:m', $start_time)."<br/>";
echo "<b>Completed Processing At:</b> ".date('m/d/Y H:i:m', $finish_time)."<br/>";
echo "<b>Processing Duration:</b> $duration_time seconds<br/><br/>";

 

 

The output:

 

Started Processing At: 11/22/2010 18:45:11

Completed Processing At: 11/22/2010 18:45:11

Processing Duration: 8.0499620437622 seconds

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.