Solved

php error date/time

Posted on 2013-12-03
2
563 Views
Last Modified: 2013-12-03
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
0
Comment
Question by:burnedfaceless
2 Comments
 
LVL 17

Expert Comment

by:Chris Harte
ID: 39692457
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

0
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39692466
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

806 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question