note 103352 deleted from function.strtotime by derick
| From: | derick@php.net | Date: | Sun, 14 Dec 2014 11:24:09 +0000 |
| Subject: | note 103352 deleted from function.strtotime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-201151@lists.php.net to get a copy of this message | ||
Note Submitter: peterson at npd dot ufsc dot br
----
A function to add two times, without using the explode function
<?php
$hour_one = "01:20:20";
$hour_two = "05:50:20";
$h = strtotime($hour_one);
$h2 = strtotime($hour_two);
$minute = date("i", $h2);
$second = date("s", $h2);
$hour = date("H", $h2);
echo "<br>";
$convert = strtotime("+$minute minutes", $h);
$convert = strtotime("+$second seconds", $convert);
$convert = strtotime("+$hour hours", $convert);
$new_time = date('H:i:s', $convert);
echo $new_time;
?>