Link to home
Start Free TrialLog in
Avatar of burnedfaceless
burnedfaceless

asked on

php error date/time

I'm going through a book for the second time and I got the following error message for the following script.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/1999/xhtml" xml: lang="en" lang = "en">
<head>
      Today&rsquo;s Date</title>
      <meta http-equiv = "content-type"
            content = "text/html; charset=utf-8" />
</head>
<body>
      <p>Today&rsquo;s date (according to this web server is
      <?php
            echo date('l, F dS Y.');
      ?>
</body>
</html>

FWIW last time I did this I used an actual server on a site and I'm assuming it could have been set not to display errors.
Screen-Shot-2013-12-03-at-8.48.1.png
Avatar of Chris Harte
Chris Harte
Flag of United Kingdom of Great Britain and Northern Ireland image

That error means that you have not set the date/time zone in your php.ini file. Look for the [Date] label. This is mine

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/London

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial