...

View Full Version : Finding difference in time?



bphein1980
08-18-2005, 02:46 PM
Everyone on here has been a huge help and I am starting to actually learn a bit of javascript.

What I am trying to do is basically just find how much time elapsed from start time to end time. I'll put some html code to what I need done. Hopefully it will explain it.




<form name="time1">
Hours
<select>
<option>0
<option>1
.... through 12
</select>

Minutes
<select>
<option>0
<option>1
.... through 59
</select>
</form>

<form name="time2">
Hours
<select>
<option>0
<option>1
.... through 12
</select>

Minutes
<select>
<option>0
<option>1
.... through 59
</select>
</form>

How many hours and minutes went by
<input name="hours" value="how many hours" />
<input name="minutes" value="how many minutes" />


*****Or instead of select boxes, just separate input fields for the hour and the minutes .... <input hours /> <input minutes /> ****************

So, if I selected 6:50 and then 7:30, I would want input "hours" to be populated with the value 0 and I would want input "minutes" to be populated with the value 40.

This would be done as standard time, not military time, so AM and PM should not matter, right?

Can this be done? Any examples or maybe even some guidance?

Thanks again!
B



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum