title: Get Current DateTime in PHP for Spacific Timezone
body: <p>The problem is really simple, but don't know why things are not working in a simple way.</p>
  
  <p>I want to have datetime of specific timezones. My server's timezone is <code>America/Chicago</code> but I want to get current datetime of different timezones. </p>
  
  <ol>
  <li>I don't want to <code>date_default_timezone_set</code> as it changes timezone for all datetime functions.</li>
  <li>I tried <code>$now = new DateTime(null, new DateTimeZone('Europe/Stockholm'));</code> with different timezone values but all returns the same value.</li>
  </ol>
  
  <p>Consider the following code</p>
  
  <pre><code>$current_time = date('Y-m-d H:i:s');
  echo "The current server time is: " . $current_time . "\r\n";
  
  $now = new DateTime(null, new DateTimeZone('America/New_York'));
  echo "America/New_York = ". $now-&gt;getTimestamp() . "\r\n";  
  
  $now = new DateTime(null, new DateTimeZone('Europe/Stockholm'));
  echo "Europe/Stockholm = ". $now-&gt;getTimestamp() . "\r\n";  
  
  $now = new DateTime(null, new DateTimeZone('Asia/Muscat'));
  echo "Asia/Muscat = ".$now-&gt;getTimestamp() . "\r\n"; 
  
  $current_time  = date('Y-m-d H:i:s');
  echo "The current server time is: " . $current_time   . "\r\n";
  </code></pre>
  
  <p>The above code results in following output</p>
  
  <pre><code>The current server time is: 2015-04-04 17:06:01
  America/New_York = 1428185161
  Europe/Stockholm = 1428185161
  Asia/Muscat = 1428185161
  The current server time is: 2015-04-04 17:06:01
  </code></pre>
  
  <p>And all three values are same, means <code>new DateTimeZone(XYZ)</code> didn't work. The expected/required output should echo current time of those specific timezones.</p>
  
  <p>Please advice if I'm missing anything.</p>