<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
	>
<channel>
	<title>Comments on: Timezone/DST handling in Javascript</title>
	<atom:link href="http://www.obanmultilingual.com/20081215/timezonedst-handling-in-javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.obanmultilingual.com/20081215/timezonedst-handling-in-javascript</link>
	<description>International SEO and PPC</description>
	<lastBuildDate>Mon, 28 Dec 2009 16:00:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Eyal</title>
		<link>http://www.obanmultilingual.com/20081215/timezonedst-handling-in-javascript/comment-page-1#comment-169</link>
		<dc:creator>Eyal</dc:creator>
		<pubDate>Mon, 28 Dec 2009 16:00:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.obanmultilingual.com/?p=120#comment-169</guid>
		<description>Hi,

There is a potential problem (that unfortunately happened to me), with the float calculations.
If for example (now_utc - now_local.getTime()) / (1000 * 3600)

results in 4.9999, parseInt would result in now_diff=4 instead of the desired 5. I changed it to Math.round and it seemed to solve the problem.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>There is a potential problem (that unfortunately happened to me), with the float calculations.<br />
If for example (now_utc &#8211; now_local.getTime()) / (1000 * 3600)</p>
<p>results in 4.9999, parseInt would result in now_diff=4 instead of the desired 5. I changed it to Math.round and it seemed to solve the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: l8nite</title>
		<link>http://www.obanmultilingual.com/20081215/timezonedst-handling-in-javascript/comment-page-1#comment-163</link>
		<dc:creator>l8nite</dc:creator>
		<pubDate>Fri, 28 Aug 2009 19:29:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.obanmultilingual.com/?p=120#comment-163</guid>
		<description>After debugging a little I think you just need to change &quot;new Date.UTC(...)&quot; to &quot;Date.UTC(...)&quot;.  I also added Milliseconds, since the Date object supports it.</description>
		<content:encoded><![CDATA[<p>After debugging a little I think you just need to change &#8220;new Date.UTC(&#8230;)&#8221; to &#8220;Date.UTC(&#8230;)&#8221;.  I also added Milliseconds, since the Date object supports it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: l8nite</title>
		<link>http://www.obanmultilingual.com/20081215/timezonedst-handling-in-javascript/comment-page-1#comment-162</link>
		<dc:creator>l8nite</dc:creator>
		<pubDate>Fri, 28 Aug 2009 19:23:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.obanmultilingual.com/?p=120#comment-162</guid>
		<description>Actually, now it doesn&#039;t seem to work for any valid DST datetime...</description>
		<content:encoded><![CDATA[<p>Actually, now it doesn&#8217;t seem to work for any valid DST datetime&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: l8nite</title>
		<link>http://www.obanmultilingual.com/20081215/timezonedst-handling-in-javascript/comment-page-1#comment-161</link>
		<dc:creator>l8nite</dc:creator>
		<pubDate>Fri, 28 Aug 2009 18:25:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.obanmultilingual.com/?p=120#comment-161</guid>
		<description>/* unit tests */
var aDSTTests = [
    // U.S.: 1987 - 2006
    [ &quot;Apr 02, 2006 01:59:00&quot;, false ],
    [ &quot;Apr 02, 2006 02:00:00&quot;, true  ],
    [ &quot;Oct 29, 2006 01:59:00&quot;, true  ],
    [ &quot;Oct 29, 2006 02:00:00&quot;, false ],

    // U.S.: 2007 -
    [ &quot;Mar 11, 2007 01:59:00&quot;, false ],
    [ &quot;Mar 11, 2007 02:00:00&quot;, true  ],
    [ &quot;Nov 04, 2007 01:59:00&quot;, true  ],
    [ &quot;Nov 04, 2007 02:00:00&quot;, false ],
];


for (var i = 0; i &lt; aDSTTests.length; i++)
{
    var sDate = aDSTTests[i][0];
    var bFlag = aDSTTests[i][1];
    var oDate = new Date(sDate);

    print(oDate);

    if (oDate.getDST() != bFlag) {
        print(&quot;FAIL: &quot; + sDate + &quot;, expected &quot; + (bFlag ? &#039;on&#039; : &#039;off&#039;));
    }
    else {
        print(&quot;PASS: &quot; + sDate + &quot;, expected &quot; + (bFlag ? &#039;on&#039; : &#039;off&#039;));
    }

    if (i != aDSTTests.length - 1) {
        print();
    }
}</description>
		<content:encoded><![CDATA[<p>/* unit tests */<br />
var aDSTTests = [<br />
    // U.S.: 1987 - 2006<br />
    [ "Apr 02, 2006 01:59:00", false ],<br />
    [ "Apr 02, 2006 02:00:00", true  ],<br />
    [ "Oct 29, 2006 01:59:00", true  ],<br />
    [ "Oct 29, 2006 02:00:00", false ],</p>
<p>    // U.S.: 2007 -<br />
    [ "Mar 11, 2007 01:59:00", false ],<br />
    [ "Mar 11, 2007 02:00:00", true  ],<br />
    [ "Nov 04, 2007 01:59:00", true  ],<br />
    [ "Nov 04, 2007 02:00:00", false ],<br />
];</p>
<p>for (var i = 0; i &lt; aDSTTests.length; i++)<br />
{<br />
    var sDate = aDSTTests[i][0];<br />
    var bFlag = aDSTTests[i][1];<br />
    var oDate = new Date(sDate);</p>
<p>    print(oDate);</p>
<p>    if (oDate.getDST() != bFlag) {<br />
        print(&quot;FAIL: &quot; + sDate + &quot;, expected &quot; + (bFlag ? &#039;on&#039; : &#039;off&#039;));<br />
    }<br />
    else {<br />
        print(&quot;PASS: &quot; + sDate + &quot;, expected &quot; + (bFlag ? &#039;on&#039; : &#039;off&#039;));<br />
    }</p>
<p>    if (i != aDSTTests.length &#8211; 1) {<br />
        print();<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: l8nite</title>
		<link>http://www.obanmultilingual.com/20081215/timezonedst-handling-in-javascript/comment-page-1#comment-160</link>
		<dc:creator>l8nite</dc:creator>
		<pubDate>Fri, 28 Aug 2009 18:24:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.obanmultilingual.com/?p=120#comment-160</guid>
		<description>Actually, same results with the new code.  Here&#039;s what I&#039;m using to test it:

/* unit tests */
var aDSTTests = [
    // U.S.: 1987 - 2006
    [ &quot;Apr 02, 2006 01:59:00&quot;, false ],
    [ &quot;Apr 02, 2006 02:00:00&quot;, true  ],
    [ &quot;Oct 29, 2006 01:59:00&quot;, true  ],
    [ &quot;Oct 29, 2006 02:00:00&quot;, false ],

    // U.S.: 2007 -
    [ &quot;Mar 11, 2007 01:59:00&quot;, false ],
    [ &quot;Mar 11, 2007 02:00:00&quot;, true  ],
    [ &quot;Nov 04, 2007 01:59:00&quot;, true  ],
    [ &quot;Nov 04, 2007 02:00:00&quot;, false ],
];


for (var i = 0; i &lt; aDSTTests.length; i++)
{
    var sDate = aDSTTests[i][0];
    var bFlag = aDSTTests[i][1];
    var oDate = new Date(sDate);

    print(oDate);

    if (oDate.getDST() != bFlag) {
        print(&quot;FAIL: &quot; + sDate + &quot;, expected &quot; + (bFlag ? &#039;on&#039; : &#039;off&#039;));
    }
    else {
        print(&quot;PASS: &quot; + sDate + &quot;, expected &quot; + (bFlag ? &#039;on&#039; : &#039;off&#039;));
    }

    if (i != aDSTTests.length - 1) {
        print();
    }
}</description>
		<content:encoded><![CDATA[<p>Actually, same results with the new code.  Here&#8217;s what I&#8217;m using to test it:</p>
<p>/* unit tests */<br />
var aDSTTests = [<br />
    // U.S.: 1987 - 2006<br />
    [ "Apr 02, 2006 01:59:00", false ],<br />
    [ "Apr 02, 2006 02:00:00", true  ],<br />
    [ "Oct 29, 2006 01:59:00", true  ],<br />
    [ "Oct 29, 2006 02:00:00", false ],</p>
<p>    // U.S.: 2007 -<br />
    [ "Mar 11, 2007 01:59:00", false ],<br />
    [ "Mar 11, 2007 02:00:00", true  ],<br />
    [ "Nov 04, 2007 01:59:00", true  ],<br />
    [ "Nov 04, 2007 02:00:00", false ],<br />
];</p>
<p>for (var i = 0; i &lt; aDSTTests.length; i++)<br />
{<br />
    var sDate = aDSTTests[i][0];<br />
    var bFlag = aDSTTests[i][1];<br />
    var oDate = new Date(sDate);</p>
<p>    print(oDate);</p>
<p>    if (oDate.getDST() != bFlag) {<br />
        print(&quot;FAIL: &quot; + sDate + &quot;, expected &quot; + (bFlag ? &#039;on&#039; : &#039;off&#039;));<br />
    }<br />
    else {<br />
        print(&quot;PASS: &quot; + sDate + &quot;, expected &quot; + (bFlag ? &#039;on&#039; : &#039;off&#039;));<br />
    }</p>
<p>    if (i != aDSTTests.length &#8211; 1) {<br />
        print();<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: l8nite</title>
		<link>http://www.obanmultilingual.com/20081215/timezonedst-handling-in-javascript/comment-page-1#comment-159</link>
		<dc:creator>l8nite</dc:creator>
		<pubDate>Fri, 28 Aug 2009 18:03:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.obanmultilingual.com/?p=120#comment-159</guid>
		<description>Thanks for the fix!  Is there a particular license on this code?</description>
		<content:encoded><![CDATA[<p>Thanks for the fix!  Is there a particular license on this code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: l8nite</title>
		<link>http://www.obanmultilingual.com/20081215/timezonedst-handling-in-javascript/comment-page-1#comment-158</link>
		<dc:creator>l8nite</dc:creator>
		<pubDate>Tue, 25 Aug 2009 21:19:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.obanmultilingual.com/?p=120#comment-158</guid>
		<description>FAIL: Mar 11, 2007 01:59:00, expected off
PASS: Mar 11, 2007 02:00:00, expected on
FAIL: Nov 04, 2007 01:59:00, expected on
PASS: Nov 04, 2007 02:00:00, expected off</description>
		<content:encoded><![CDATA[<p>FAIL: Mar 11, 2007 01:59:00, expected off<br />
PASS: Mar 11, 2007 02:00:00, expected on<br />
FAIL: Nov 04, 2007 01:59:00, expected on<br />
PASS: Nov 04, 2007 02:00:00, expected off</p>
]]></content:encoded>
	</item>
</channel>
</rss>
