<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jaymin Patel &#187; daylight saving time</title>
	<atom:link href="http://www.jayminkapish.com/tag/daylight-saving-time/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jayminkapish.com</link>
	<description>Wordpress Developer, New York</description>
	<lastBuildDate>Wed, 09 Nov 2011 15:33:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
		<item>
		<title>WordPress: Automatically adjust for daylight saving time</title>
		<link>http://www.jayminkapish.com/2008/11/12/wordpress-automatically-adjust-for-daylight-saving-time/</link>
		<comments>http://www.jayminkapish.com/2008/11/12/wordpress-automatically-adjust-for-daylight-saving-time/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 17:55:36 +0000</pubDate>
		<dc:creator>Jaymin Patel</dc:creator>
				<category><![CDATA[KAPISH]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[daylight saving time]]></category>
		<category><![CDATA[daylight saving time and wordpress]]></category>
		<category><![CDATA[daylight saving time wordpress plugin]]></category>
		<category><![CDATA[wordpress and daylight saving time]]></category>
		<category><![CDATA[wordpress timezone settings]]></category>

		<guid isPermaLink="false">http://blog.kapish.co.in/?p=29</guid>
		<description><![CDATA[Wordpress Plugin to adjust daylight saving time automatically.]]></description>
			<content:encoded><![CDATA[<p>I have been googling for this and (again) I had to come up with my own solution.</p>
<div class="phpcode">
<pre>
<code>function my_set_gmt_offset($offset) {
        global $wpdb;

        /* WordPress default sets to UTC timezone
        in wp-settings.php.
        you can change this line to whatever your timezone is.
        I set it to my timezone (NY)
        More: http://www.php.net/manual/en/timezones.php
        */

        if(function_exists('date_default_timezone_set'))
	        date_default_timezone_set('America/New_York');

	$timezone = date("T");

        /* Now we have your local timezone stored in $timezone
        so lets restore wordpress setting as in wp-settings.php */

        if ( function_exists('date_default_timezone_set') )
	       date_default_timezone_set('UTC');

	$current_offset = $offset;

	if($timezone == 'EDT') {
		$offset = '-4';
	}
	else if($timezone == 'EST') {
		$offset = '-5';
	}

	if($offset != $current_offset) {
		/* update offset in database if new offset is different.
		   Do not use update_option since it will call
                   this filter again and cause infinite loop.
		 */
		$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->options
		SET option_value = %s WHERE
		option_name = %s", $offset, 'gmt_offset' ) );

		/* let wordpress regenerate cache from database */
		wp_cache_set('gmt_offset', 'checkthedatabaseplease', 'options');
	}

	return $offset;
}

add_filter('option_gmt_offset', 'my_set_gmt_offset');
</code></pre>
</div>
<p>Share your feedback via comments.</p>
<h3>Most Commented Posts</h3><ul class="related_post"><li><a href="http://www.jayminkapish.com/2008/06/13/comments-pagination-wordpress/" title="Comments Pagination &#8211; Wordpress &#8211; Bug Fixed!">Comments Pagination &#8211; Wordpress &#8211; Bug Fixed! (22)</a></li><li><a href="http://www.jayminkapish.com/2008/01/18/wordpress-database-schema/" title="Wordpress Database Schema">Wordpress Database Schema (13)</a></li><li><a href="http://www.jayminkapish.com/2009/06/16/date-archive-for-a-category/" title="Date archive for a category">Date archive for a category (10)</a></li><li><a href="http://www.jayminkapish.com/2008/02/07/migrate-from-utw-tags-to-wordpress-23-terms/" title="Migrate Tags from UTW Tags to Wordpress 2.3 Terms">Migrate Tags from UTW Tags to Wordpress 2.3 Terms (9)</a></li><li><a href="http://www.jayminkapish.com/2009/03/17/json-and-wordpress/" title="JSON and Wordpress">JSON and Wordpress (9)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.jayminkapish.com/2008/11/12/wordpress-automatically-adjust-for-daylight-saving-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.jayminkapish.com @ 2012-02-07 02:42:06 by W3 Total Cache -->
