Re: Getting elapsed time between two MySQL time fields

From: Date: Tue, 01 Jan 2002 00:15:24 +0000
Subject: Re: Getting elapsed time between two MySQL time fields
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-79157@lists.php.net to get a copy of this message
<? $d1=mktime(13,44,20,1,1,2002);//first three variables are your time and last are a random day $d2=mktime(13,49,25,1,1,2002); echo date("i:s",$d2-$d1); ?> -- Best regards, George Nicolae IT Manager ___________________ X-Playin - Professional Web Design www.x-playin.f2s.com "Tom Beidler" <tom@orbittechservices.com> wrote in message news:B8561DC9.33B1%tom@orbittechservices.com... > I have some records in a MySQL database that store a start and stop time. In > my display page that displays the record info I would like to use PHP to > find the elapsed time between the two fields. So if I had; > > Start 13:44:20 > Stop 13:49:25 > > Possibly use a function to calculate > Elapsed 5:05 > > Do I need to do this in MySQL? > > Thanks, > Tom

« previous php.general (#79157) next »