Time difference calculation in php/mysql using class&objects
Moderator: General Moderators
Time difference calculation in php/mysql using class&objects
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...
Last edited by John Cartwright on Wed Apr 16, 2008 9:08 am, edited 1 time in total.
Reason: Why did you bold your entire post!?
Reason: Why did you bold your entire post!?
Re: Time difference calculation in php/mysql using class&objects
you could explode the value of timeField
Code: Select all
$timeSplit = explode(':', '$timeFromDB');
$hour = $timeSplit[0];
$seconds = $timeSplit[1];
//do you other stuff