title: How to get server time not localtime in php
body: <p><strong>First Part of the Question :</strong></p>
  
  <p>When I m using <code>new Date ();</code> in Javascript.</p>
  
  <p>it gives </p>
  
  <pre><code>Fri Jun 19 2015 11:18:02 GMT+0530 (India Standard Time)
  </code></pre>
  
  <p>This is giving my local machine time.whereas server time is 7 mins ahead.</p>
  
  <p>Is there any function which gives server time not local machine time same exactly as <code>new Date()</code> But from server not localMachine.</p>
  
  <p>In My project i am using codeigniter.is there any method to keep datetime same as servertime not localmachine time.</p>
  
  <p>so when i use echo <code>date('Y-m-d H:i:s')</code>. This gives server time.</p>
  
  <p><strong>Second part of the question :</strong></p>
  
  <p>How to echo date in php in the same format like <code>new Date()</code> in Javascript:</p>
  
  <p><code>new Date()</code> Prints <code>Fri Jun 19 2015 11:18:02 GMT+0530 (India Standard Time)</code></p>
  
  <p>But in Php <code>date('D M Y G:i:s T', time());</code> is giving <code>Fri Jun 19 2015 11:18:02 IST</code></p>
  
  <p>How to achieve same format like <code>new Date()</code>.</p>