First PHP script error

I get this error on local server
Warning: date() []: It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/New_York’ for ‘-4.0/DST’ instead in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ oday.php on line 13
Saturday, June 08th 2013.

with this very first script

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

Actually the message you received is a warning which is determined by your error_reporting() status.

Take a look at the Php Manual site and scroll down to Section on Examples



Great, thanks!

Better would be to pick one of the supported timezones and enter it in your php.ini, e.g.,

date.timezone = Europe/Amsteram

so it applies server wide and you don’t have to set it over and over for every script/website you write :slight_smile: