duttydea Posted August 11, 2008 Share Posted August 11, 2008 I have a Table that store my start & finish time for Work. Work_Date Start Finish Lunch 2008-08-09 07:00:00 14:00:00 Yes 2008-08-11 07:00:00 17:00:00 Yes I have tried the code below and get 01:00 $elapsed = ($row["Finish"]) - ($row["Start"]); echo date("H:i", $elapsed); ?> Can someone help? Thanks in advance Quote Link to comment Share on other sites More sharing options...
discomatt Posted August 11, 2008 Share Posted August 11, 2008 User strtotime() to convert it into a timestamp, subtract start from end, and you;'re left with the amount of seconds you've been working. Quote Link to comment Share on other sites More sharing options...
duttydea Posted August 11, 2008 Author Share Posted August 11, 2008 sorry!! Im a noob! how do i do that? Quote Link to comment Share on other sites More sharing options...
discomatt Posted August 11, 2008 Share Posted August 11, 2008 Read up on strtotime http://php.net/manual/en/function.strtotime.php Give it an attempt. If you're still not sure, reply here. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.