Solved

php error date/time

Posted on 2013-12-03
2
573 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 110

Accepted Solution

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

687 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