Problems with time calculation

From: Date: Thu, 28 Sep 2000 08:06:40 +0000
Subject: Problems with time calculation
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-17875@lists.php.net to get a copy of this message
thanks for answering. Ok, I send you parts of the code: the create_table thing is: $sql="create table work (... start time, end time, ...) then the other script: ... $start = mysql_result($result,$i,"beginn"); $end = mysql_result($result,$i,"ende"); $work = $end - $start echo &work; ... or should I take a different time /date function for the calculation? -----Ursprüngliche Nachricht----- Von: David Robley [mailto:huntsman@hermes.nisu.flinders.edu.au] Gesendet: Donnerstag, 28. September 2000 09:45 An: Mai Truong; php-general@lists.php.net Betreff: Re: [PHP] Problems with time calculation On Thu, 28 Sep 2000, Mai Truong wrote: > I need some help for the following problem: > > I created a table with two columns taking the column type 'time' . > Trying to subtract the times that I filled in from each other, PHP only > delivers the difference of the values of the hours. > Could anyone tell me , what I did wrong or how I should proceed to get the > result in the format hh:mm:ss? > Thanx in advance > Mai Without seeing what your code does it's a bit hard to say what you have done wrong, if anything. The function you probably want to look at is date(), or you might even be able to do the calculation in your sql query, depending on your database package/version. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#17875) next »