title: PHP - date() vs. date.timezone / date_default_timezone_set()
body: <p>I've just got a new computer, and I've been setting up PHP/MySQL/databases etc... I think I'm just about there, except it's thrown this curveball. My login script was working fine, but now it's spitting the following warning (which messes up the JSON).</p>
  
  <blockquote>
    <p><b>Warning</b>:  date() [function.date]:
    It is not safe to rely on the system's timezone settings. You are
    <em>required</em> 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 'Antarctica/Macquarie'
    for 'EST/10.0/no DST' instead in <b>.../php/login.php</b> on line
    <b>47</b><br /></p>
  </blockquote>
  
  <p>My code obviously uses <code>date()</code> and is working in the live version and on the old machine. I get two warnings for the following two lines of code:</p>
  
  <pre><code>$date = date("ymd");
  
  $this_year = date("y");
  </code></pre>
  
  <p>My research (see <a href="http://php.net/manual/en/datetime.configuration.php">here</a>) suggests that the behaviour of these functions depends on php.ini . </p>
  
  <p>So should I change php.ini on the new machine, or am I using some kind of deprecated method, and should I ditch <code>date()</code> altogether?</p>
  
  <p>Thanks.</p>