<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>Setting your default timezone with PHP&#039;s date_default_timezone_set()</title>
<link>http://www.mdj.us/</link>
<description>Set your default timezone with PHP, without having access to the php.ini file.</description>
<language>en</language>
<item>
<title>Matt</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/setting-your-default-timezone-with-phps-datedefaulttimezoneset/#comment-583</link>
<pubDate>Wed, 21 Oct 2009 11:32:07 +0000</pubDate>
<content:encoded><![CDATA[Patricio, I don't think you can do that with timezones, you'd need to manipulate the actual date returned before formatting it. If you're using sNews, you'd do something like this;<br />
<br />
Basically, where to you see<br />
<br />
[code]date(s('date_format'), strtotime($r['date']));[/code]<br />
change it to<br />
<br />
[code]date(s('date_format'), strtotime(&quot;$r[date] -12 hours&quot;));<br />
[/code]Note the &quot;-12 hours&quot; bit.]]></content:encoded>
</item>
<item>
<title>Patricio</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/setting-your-default-timezone-with-phps-datedefaulttimezoneset/#comment-582</link>
<pubDate>Wed, 21 Oct 2009 02:04:00 +0000</pubDate>
<content:encoded><![CDATA[I need to set the date to -12 hours before NOW...<br />
I tried finding some place opposite on the globe to set the timezone...<br />
but I need to set it to yesteday...<br />
is there any easy way to do that?]]></content:encoded>
</item>
<item>
<title>slemborg</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/setting-your-default-timezone-with-phps-datedefaulttimezoneset/#comment-412</link>
<pubDate>Tue, 12 May 2009 18:31:15 +0000</pubDate>
<content:encoded><![CDATA[I've no idea why it happen, but the .htaccess did sort it, and for me that's fine, although, i'd like to find out why it all of a sudden just &quot;rolled back&quot; to default.]]></content:encoded>
</item>
<item>
<title>Matt</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/setting-your-default-timezone-with-phps-datedefaulttimezoneset/#comment-408</link>
<pubDate>Tue, 12 May 2009 12:58:39 +0000</pubDate>
<content:encoded><![CDATA[Hmmm, I wonder why it was being over-written?<br />
<br />
.htaccess method is just as good though, helpful too if you need it set site-wide across a lot of files.]]></content:encoded>
</item>
<item>
<title>slemborg</title>
<description></description>
<link>http://www.mdj.us/web-development/php-programming/setting-your-default-timezone-with-phps-datedefaulttimezoneset/#comment-400</link>
<pubDate>Sat, 09 May 2009 02:54:18 +0000</pubDate>
<content:encoded><![CDATA[Hey.<br />
<br />
I actually tried this method some time ago, but odd this happend, one day my timezones where correct, a few days later they weren't, so what I did, was to use the .htaccess file and added:<br />
<br />
php_value date.timezone 'Europe/Copenhagen' <br />
<br />
at the very top of the file, which works flawlessly for me.]]></content:encoded>
</item>
</channel>
</rss>

