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

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.