This standard, published, code echos tomorrow’s date on my Windows 8.1 HP Envy laptop - which reports the date is actually today’s date. What the heck is going on?
I am doing this on Monday June 15, 2015 and the resulting echo’d statement (through IE, FireFox, and Chrome) is Tuesday June 16th, 2015…
Ideas?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Today's Date</title>
</head>
<body>
<p>
Today's date (according to this web server) is
<?php echo (date('l F jS Y.')); ?>
</p>
</body>
</html>
And the time shown in the corner of your screen and the timezone in your ini are correct?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Today's Date</title>
</head>
<body>
<p>
Today's date (according to this web server) is
<?php echo (date('l F jS Y.')); ?>
</p>
</body>
</html>
Not if your web server is using UTC and the rest of the computer is seven hours behind. It would mean that it would swap days at 5pm your time instead of midnight.
Web servers do not use the same timezone as that set in the operating system - unless you specifically set both the same. Setting a web server to use UTC is quite common as visitors can come from anywhere in the world and that is the standard timezone that all your visitor’s timezones are measured from.