title: PHP's DateTime default timezone
body: <p>I just recently started using the DateTime object in PHP, and now I can't get this figured out.</p>
  
  <p>I thought that <code>DateTime</code> would take into account the default timezone I set with <code>date_default_timezone_set</code>, but apparently it does not:</p>
  
  <pre><code>date_default_timezone_set('Europe/Oslo');
  $str = strtotime('2015-04-12');
  $date = new DateTime("@".$str);
  $response['TZ'] = $date-&gt;getTimezone()-&gt;getName();
  $response['OTZ'] = date_default_timezone_get();
  $response['Date'] = $date-&gt;format('Y-m-d');
  
  echo json_encode($response);
  </code></pre>
  
  <p>This is the response I get:</p>
  
  <pre><code>{
    "TZ":"+00:00",
    "OTZ":"Europe\/Oslo",
    "Date":"2015-04-11"
  }
  </code></pre>
  
  <p>Passing the correct DateTimeZone to the constructor is not working either, as DateTime ignores it when it is given an UNIX timestamp. (It works if I am passing a regular date string to the constructor).</p>
  
  <p>If I do this the date comes up correctly:</p>
  
  <p><code>$date-&gt;setTimezone(new DateTimeZone("Europe/Oslo"));</code></p>
  
  <p>I don't really want to have to pass the timezone along every time I am dealing with a date, but from what it looks like I might have to?</p>