I am trying to make a clocking system so that people I make websites for can see what I have done when. I have two time stamps in a SQL database.
I want to find out how many hours are between them as I am paid by the hour.
When I query my table, i get the time stamps and assing them to variables
$clock_in;
$clock_out;
And i want to find the hours/mins between them.
Thanks
Use the PHP strtotime() function on your SQL timestamp, then simply subtract $clock_in from $clock_out to give you the number of seconds between the two. Divide by 60 to get minutes.