Yeah, its not 10min after midnight. Its a time just as you sayd: 00hours 10 minutes 00 seconds.
Now I tested both codes and they work fine. But when I tried to edite them something strange happened:
Code: Select all
Session_start();
$buildtime = $_SESSION['buildtime'];
$localtime = $_SESSION['localtime'];
echo "Localtime ";
require 'localtime.php';
echo "<br>";
echo "Buildtime: ";
echo $buildtime;
echo "<br>";
echo "Ready at: ";
list($h, $m, $s) = explode(":", $buildtime);
echo date("H:i:s", strtotime("+$h hours $m minutes $s seconds", $localtime));
Thats the new code, and the output is:
Localtime 10:45:22
Buildtime: 00:10:00
Ready at: 02:10:10
You see here that $localtime is now from a session but when I echo it the time is right ( same as it would be $localtime = time(); ). But still I dont get the right "Ready at: " time ?
EDIT: Now I tried another code, but still get this output:
Localtime 18:51:35
Buildtime: 00:10:00
Ready at: 02:10:18
code:
Code: Select all
<?php
Session_start();
date_default_timezone_set('Europe/Helsinki');
$buildtime = $_SESSION['buildtime'];
$localtime = date("H:i:s");
echo "Localtime ";
echo $localtime;
echo "<br>";
echo "Buildtime: ";
echo $buildtime;
echo "<br>";
echo "Ready at: ";
list($h, $m, $s) = explode(":", $buildtime);
echo date("H:i:s", strtotime("+$h hours $m minutes $s seconds", $localtime));
?>