Page 1 of 1

Time difference calculation in php/mysql using class&objects

Posted: Wed Apr 16, 2008 7:57 am
by satz
Hi Everybody.... I have been facing the problem of calculating time difference for past two days....i wil feel happy if somebody comes with a suggestion for it.... login time is entered in hh:ss form in one form selecting from drop down and store in db... when retrieving it in another form for calculating time difference i am facing a prob in splitting it and calculating the time difference... if both the login & logout time which is selected thru dropdown are in same form then on clicking the hour textbox the time is calculated & shown...

Re: Time difference calculation in php/mysql using class&objects

Posted: Wed Apr 16, 2008 8:55 am
by ianhull
you could explode the value of timeField

Code: Select all

 
 
$timeSplit = explode(':', '$timeFromDB');
 
$hour = $timeSplit[0];
$seconds = $timeSplit[1];
 
//do you other stuff