title: Magento ouputting incorrect date and time
body: <p>If I output the date/time in index.php <code>echo date('m/d/Y h:i:s a', time());</code>. It's correct. If I output the date/time anywhere after that, in an extension for example it's off 4 hours exactly. I've set the timezone properly in php.ini and in Magento itself so not sure what's causing it to be off. I'm running version 1.7.0.2.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Ok so I've learned a few things.</p>
  
  <p>Magento always sets the timezone to UTC in 
  app/mage.php </p>
  
  <pre><code>line 767: date_default_timezone_set('UTC')
  </code></pre>
  
  <p>So, basically you can't use date(),time() etc. You have to set your targetting timezone in Admin->System->Configuration / General->Locale options and use something like:</p>
  
  <pre><code>$now = Mage::getModel('core/date')-&gt;timestamp(time());
  echo date('m/d/y h:i:s', $now);
  </code></pre>
  
  <p>I could always replace line 767 with my timezone but I don't like modifying core code. Are there any other options out there ???</p>