<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
  <title>aC forum: GMT timezone offset workaround for 0.7.1</title>
  <link>http://www.activecollab.com/forums/topic/1592/</link>
  <description>Recent posts on topic: GMT timezone offset workaround for 0.7.1</description>
  <dc:language>en-us</dc:language>
  <pubDate>Sun, 12 Oct 2008 23:32:11 UTC</pubDate>
  
  <item>
    <link>http://www.activecollab.com/forums/post/7636/#post7636</link>
    <guid>http://www.activecollab.com/forums/post/7636/#post7636</guid>
    <title>Post #1 by Beni</title>
    <dc:creator>Beni</dc:creator>
    <description><![CDATA[<p><i><b>Update:</b> Forget about what I wrote in this post... I realised that I have a problem with daylight saving and not with a timezone offset. This hack solves the daylight saving problem, but it causes another problem with the milestone dates... I'll work on a hack that solves this problem too...</i><br />
<br />
<br />
<div class="postQuote"><blockquote><div class="quoteAuthor">Ilija Studen:</div>activeCollab currently works only with GMT dates so if you are in timezone different than GMT all dates in the system will be offset. <a href="http://www.activecollab.com/forums/topic/1254/" target="_blank" rel="nofollow">http://www.activecollab.com/forums/topic/1254/</a></blockquote></div> <br />
<br />
If you want to fix that before the release of 1.0, you can try hacking the file<br />
<br />
<pre name="code" class="html">/environment/classes/localization/Localization.class.php</pre><br />
like I did. I changed the functions 'formatDate', 'formatDescriptiveDate', 'formatDateTime' and 'formatTime'. All these functions return a formatted date string in this way (example from 'formatDate'):<br />
<br />
<pre name="code" class="html">return date($this-&gt;date_format, $date-&gt;getTimestamp() + ($timezone * 3600));</pre><br />
<br />
I replaced $timezone by ($timezone + 1) because I live in GMT +1 (Germany), so that the line of code became:<br />
<br />
<pre name="code" class="html">return date($this-&gt;date_format, $date-&gt;getTimestamp() + ( <b>($timezone + 1)</b> * 3600));</pre><br />
<br />
You have to replace $timezone (just in the 'return'-line of the code) within the functions 'formatDate', 'formatDescriptiveDate', 'formatDateTime' and 'formatTime'. If you live in GMT +10 or something else, try ($timezone + 10).<br />
<br />
<br />
<i><b>Update:</b> Forget about what I wrote in this post... I realised that I have a problem with daylight saving and not with a timezone offset. This hack solves the daylight saving problem, but it causes another problem with the milestone dates... I'll work on a hack that solves this problem too...</i></p>]]></description>
    <pubDate>Thu, 03 May 2007 20:45:40 UTC</pubDate>
  </item>
</channel>
</rss>