[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

php error date/time

Posted on 2013-12-03
2
Medium Priority
?
594 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 111

Accepted Solution

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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month19 days, 5 hours left to enroll

834 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