RE: [PHP] Convert Hours to Decimal

From: Date: Wed, 19 Oct 2011 23:22:26 +0000
Subject: RE: [PHP] Convert Hours to Decimal
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-315361@lists.php.net to get a copy of this message
> -----Original Message----- > From: parasane@gmail.com [mailto:parasane@gmail.com] On Behalf Of Daniel > Brown > Sent: Monday, October 17, 2011 3:06 PM > To: Don Wieland > Cc: php-general@lists.php.net > Subject: Re: [PHP] Convert Hours to Decimal > > On Mon, Oct 17, 2011 at 17:57, Don Wieland <donw@dwdataconcepts.com> wrote: > > Hey Tim, > > > > I got a select string: > > > > select timediff(cast(out_1 as time), cast(in_1 as time)) tHours FROM > > lm_tc_trans WHERE tc_trans_id = '42' > > > > result = 08:45:00 > > > > How do i convert that to a FLOAT (5,2) =  8.75 > > > > or > > > > result = 08:15:00 > > > > How do i convert that to a FLOAT (5,2) =  8.25 > > It's been a while since folks here have been pushing the acronyms > that used to be the norm on this list: GIYF, RTFM, et cetera. So you > get to be the lucky example, Don: Google Is Your Friend. > > http://tinyurl.com/3snzw52 > > That quick term then brings up: > > http://www.hashbangcode.com/blog/converting-and-decimal-time-php-522.html LOLercopter. I love your sass! I've even felt the burn on occasion, but it's always appreciated in my book. :)

« previous php.general (#315361) next »