...

View Full Version : Subtracting Time Problem



coolumanga
11-12-2010, 09:34 AM
Hi Again

i have a two time values

$to=09:00:00

$from=10:00:00

$diff= $from -$to ...........

how do i do this ..... and also i want get answer as minites

plzzzzzz help me for solve this

BulletTimeBill
11-12-2010, 09:47 AM
I'm not sure if there's an inbuilt function or something. But i'd use seconds to do the math then write a function to turn it into a string of a time format. Then there is this http://php.net/manual/en/function.strtotime.php if you want an actual time stamp....but then I always do stuff the hard way :P

poyzn
11-12-2010, 10:25 AM
if your php >= 5.3 you can use date_diff (http://php.net/manual/en/function.date-diff.php) function :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum