I was trying to get the time()
on a PHP page (localhost), but it seemed it was returning wrong dates. So I tried:
date_default_timezone_set("America/Chicago");
echo "America/Chicago:".time();
echo "<br>";
date_default_timezone_set("Europe/Helsinki");
echo "Europe/Helsinki:".time();
Which outputs:
America/Chicago:1439981623
Europe/Helsinki:1439981623
How is it that these two values are the same? How can I make sure this particular php-page returns times in my timezone, without changing the php.ini file?