View Full Version : Subtracting Time Problem

11-12-2010, 10:34 AM
Hi Again

i have a two time values



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

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

plzzzzzz help me for solve this

11-12-2010, 10: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

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