Re: [PHP] Seconds to minutes

2002-11-19 Thread Bob Irwin
quot;Jonathan Sharp" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: "'Matt'" <[EMAIL PROTECTED]>; "'Bob Irwin'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, November 20, 2002 12:41 PM Subject: Re: [PHP] Seconds t

Re: [PHP] Seconds to minutes

2002-11-19 Thread Jonathan Sharp
i'll just throw my code in here while we're at it... $seconds = 3600*5 + (60 * 10) + 45; $hours = floor( $seconds / 3600 ); $mins = floor( ($seconds % 3600) / 60 ); $seconds = floor( ($seconds % 60) ); echo "Hours: $hours\nMins: $mins\nSeconds: $seconds\n"; -js John W. Holmes wrote: >>You can

Re: [PHP] Seconds to minutes

2002-11-19 Thread Morgan Hughes
On Wed, 20 Nov 2002, Bob Irwin wrote: > Its seems far more reliable than what I am using (dividing by 60 for > minutes, 3600 for hours and doing rounding, exploding if its not a round > number etc). > > Its only for measuring short times, so Matt's suggestion should work ok. > Ideally though, beca

Re: [PHP] Seconds to minutes

2002-11-19 Thread Support @ Fourthrealm.com
'Bob Irwin'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, November 20, 2002 12:09 PM Subject: RE: [PHP] Seconds to minutes > > You can do something like this: > > > $seconds = 265; > > $time = date('i s',$seconds); > >

Re: [PHP] Seconds to minutes

2002-11-19 Thread Bob Irwin
t;; "'Bob Irwin'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, November 20, 2002 12:09 PM Subject: RE: [PHP] Seconds to minutes > > You can do something like this: > > > $seconds = 265; > > $time = date('i s',$secon

RE: [PHP] Seconds to minutes

2002-11-19 Thread John W. Holmes
> You can do something like this: > $seconds = 265; > $time = date('i s',$seconds); > $minSecs = explode(' ',$time); > echo "{$minSecs[0]} minutes and {$minSecs[1]} seconds\n"; > ?> That doesn't work for anything over 3599 seconds, though... ---John Holmes... -- PHP General Mailing List

Re: [PHP] Seconds to minutes

2002-11-19 Thread Matt
>From: "Bob Irwin" <[EMAIL PROTECTED]> > Sent: Tuesday, November 19, 2002 7:27 PM >Subject: [PHP] Seconds to minutes > At the moment, I'm using quite a few lines of code to convert seconds to > minutes and hours. I'm thinking, surely I'm missing somet

[PHP] Seconds to minutes

2002-11-19 Thread Bob Irwin
Hey Guys, At the moment, I'm using quite a few lines of code to convert seconds to minutes and hours. I'm thinking, surely I'm missing something really simple! Is there a PHP function that converts seconds to minutes? Or is it a 4 or 5 (and not always that accurate) lines of code? Any ideas or