Page 1 of 1

Subtract hours

Posted: Sat Aug 08, 2009 11:40 am
by proveyourselfthom
Hello,
for exemple, with a hour in MySQL format (hh:mm:ss), i want to subtract 02:50:35 hours from 35:00:00 hours. Is there a way to subtract hours bigger than 24 hours?
Thank you!

Re: Subtract hours

Posted: Sat Aug 08, 2009 2:47 pm
by Eran
did you mean in PHP or SQL? you can do this to subtract hours from a timestamp:

Code: Select all

SELECT '2009-08-08 02:50:00' - INTERVAL 35 HOUR

Re: Subtract hours

Posted: Mon Aug 10, 2009 5:33 am
by proveyourselfthom
I'm talking about php but this time is on db.
Thank's guys!