unistake Posted January 31, 2010 Share Posted January 31, 2010 I am trying to put together a string of times. e.g: $time1 = '01:20"; $time2 = '00:45'; $timetotal = $time1 + $time2; echo $timetotal; when I try to echo time total it comes up as an integer, how can I display the above so the output is '02:05'. Thanks all Link to comment https://forums.phpfreaks.com/topic/190463-adding-php-time-variables/ Share on other sites More sharing options...
Catfish Posted January 31, 2010 Share Posted January 31, 2010 http://www.php.net/manual/en/function.date-add.php#85632 User submitted function to add two times together. Probably an easier way to do this but I've never had to do it myself. Link to comment https://forums.phpfreaks.com/topic/190463-adding-php-time-variables/#findComment-1004666 Share on other sites More sharing options...
unistake Posted January 31, 2010 Author Share Posted January 31, 2010 thanks, ill have a fiddle! Link to comment https://forums.phpfreaks.com/topic/190463-adding-php-time-variables/#findComment-1004667 Share on other sites More sharing options...
unistake Posted February 5, 2010 Author Share Posted February 5, 2010 can anyone think of a simple way that that?! cheers Link to comment https://forums.phpfreaks.com/topic/190463-adding-php-time-variables/#findComment-1007622 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.