PHP Version 5.0.4
MySQL 4.1.14
phpMyAdmin 2.6.3-pl1
Apache/2.0.54 (Win32)
Ok I have a project im working on for my work and even tho i've been around php for a number of years this is really taxing my idea's.
My main problem is that i have a form where people fill out their info. Two fields are Starttime and Endtime all in Military time (ie 13:00 and 15:00 hrs). My problem is that im tryin to get the total amount of hours between two different times, 13:00-15:00, correct format. All i get is 2 and that it.
This is what i have in the form assigntask.php file
Code: Select all
Start Time: (HH:MM)</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='starttime' size=5>* (military time)</td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">
End Time: (HH:MM)</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='endtime' size=5>* (military time)</td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">If i use something like this in the process.php portion then i get a 5:00:02
Code: Select all
$hoursspent = date('h:i:s',$endtime - $starttime);