note 94217 added to function.mktime

From: Date: Fri, 23 Oct 2009 02:18:30 +0000
Subject: note 94217 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-161997@lists.php.net to get a copy of this message
I was having problem in adding (h:i) format. i use the following codes but it turns out wrong. date_default_timezone_set('UTC'); $hours_diff = strtotime("02:00:00")+strtotime("01:00:00"); echo "<br>". date('h:i', $hours_diff); for adding: output: 08:31 date_default_timezone_set('UTC'); $hours_diff = strtotime("02:00:00")-strtotime("01:00:00"); echo "<br>". date('h:i', $hours_diff); for subtracting output: 01:00 I want the output to have a colon but im having a hard time doing it. ---- Server IP: 69.147.83.197 Probable Submitter: 222.127.190.240 ---- Manual Page -- http://www.php.net/manual/en/function.mktime.php Edit -- https://master.php.net/note/edit/94217 Del: integrated -- https://master.php.net/note/delete/94217/integrated Del: useless -- https://master.php.net/note/delete/94217/useless Del: bad code -- https://master.php.net/note/delete/94217/bad+code Del: spam -- https://master.php.net/note/delete/94217/spam Del: non-english -- https://master.php.net/note/delete/94217/non-english Del: in docs -- https://master.php.net/note/delete/94217/in+docs Del: other reasons-- https://master.php.net/note/delete/94217 Reject -- https://master.php.net/note/reject/94217 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#161997) next »