Actually, step 3 should be:<div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><font face="arial, helvetica, sans-serif">3. For each </font><font face="&#39;courier new&#39;, monospace">rule </font><font face="arial, helvetica, sans-serif">in </font><font face="&#39;courier new&#39;, monospace">file</font><font face="arial, helvetica, sans-serif">: </font><font face="&#39;courier new&#39;, monospace">if (ref_time &gt;= rule[from]) AND (ref_time &lt; rule[to])</font> then return <font face="&#39;courier new&#39;, monospace">rule</font>.</span></div>
<div><br><div class="gmail_quote">On Thu, Apr 1, 2010 at 4:32 PM, Richard Tibbett | World Time Engine <span dir="ltr">&lt;<a href="mailto:richard@worldtimeengine.com">richard@worldtimeengine.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Chad, All,<div><br></div><div>Whilst I don&#39;t have a full Javascript library that could help you here I have compiled the tz database in to a number of common formats (including Javascript/JSON) and created an open source project over at Google Code [1] where you can download the data for any library you intend to create.</div>

<div><br></div><div>From there I would expect that the JSON dataset would be of interest. To select the appropriate timezone rule you would perform the following steps (in pseudo-code):</div><div><ol><li>Obtain the UTC timestamp (<font face="&#39;courier new&#39;, monospace">ref_time</font>) for the reference time you intend to work with.</li>

<li>Obtain and include the necessary tzdata js file (<font face="&#39;courier new&#39;, monospace">file</font>) according to the TZ Identifier requested (e.g. &#39;Pacific/Pago_Pago&#39; will translate to the tzdata file &#39;/tzdata/js/Pacific/Pago_Pago.js&#39;).</li>

<li><font face="arial, helvetica, sans-serif">For each </font><font face="&#39;courier new&#39;, monospace">rule </font><font face="arial, helvetica, sans-serif">in </font><font face="&#39;courier new&#39;, monospace">file</font><font face="arial, helvetica, sans-serif">: </font><font face="&#39;courier new&#39;, monospace">if (ref_time &gt; rule[from]) AND (ref_time &lt;= rule[to])</font> then return <font face="&#39;courier new&#39;, monospace">rule</font>.</li>

<li>Apply <font face="&#39;courier new&#39;, monospace">rule[offset]</font> provided in <font face="&#39;courier new&#39;, monospace">rule </font>to <font face="&#39;courier new&#39;, monospace">ref_time</font>.</li>
</ol></div><div>Let me know if you have any feedback or further questions on the data provided.</div><div><br></div><div>If you do create a Javascript library from the data at [1] I hope you will consider making it open source so the community at large can benefit from your hard work.</div>

<div><br></div><div>Hope this helps and good luck :-)</div><div><br></div><div>[1] <a href="http://code.google.com/p/tzdata/" target="_blank">http://code.google.com/p/tzdata/</a></div><div><br></div><div>Richard Tibbett</div>
<div><a href="http://worldtimeengine.com" target="_blank">WorldTimeEngine.com</a></div><div><div></div><div class="h5">
<div><br></div><br><div class="gmail_quote">On Mon, Mar 29, 2010 at 8:15 PM, Olson, Arthur David (NIH/NCI) [E] <span dir="ltr">&lt;<a href="mailto:olsona@dc37a.nci.nih.gov" target="_blank">olsona@dc37a.nci.nih.gov</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;m forwarding this message from Chad Eberle, who is not on the time zone mailing list. Those of you who are on the list, please direct replies appropriately.<br>


<br>
                                --ado<br>
<br>
-----Original Message-----<br>
From: Chad Eberle [mailto:<a href="mailto:ceberle@co.pierce.wa.us" target="_blank">ceberle@co.pierce.wa.us</a>]<br>
Sent: Monday, March 29, 2010 1:15<br>
To: <a href="mailto:tz@lecserver.nci.nih.gov" target="_blank">tz@lecserver.nci.nih.gov</a><br>
Subject: Questions about tzdata implementations<br>
<br>
I apologize if this isn&#39;t the right place for this question, but would<br>
appreciate any help with tracking down the answer to these questions.<br>
<br>
Background: We have Java web services that send back date/time values with GMT<br>
offsets adjusted for DST following historical rules that match what I see in the<br>
northamerica file for America/Los_Angeles. Our client code is largely<br>
JavaScript, and depending on the operating system, will sometimes be incongruous<br>
about when DST starts or ends (dates before 2007 on Windows and before 1950. As<br>
one can imagine, this has caused a few problems.<br>
<br>
I can&#39;t seem to find any solution for the JavaScript end, so I was planning on<br>
writing one myself (if anyone knows of a solution, I&#39;d appreciate any pointers).<br>
<br>
My questions:<br>
<br>
1) Is there some reference implementation for the algorithm that selects the<br>
correct rule for a given date?<br>
<br>
2) For the general US rules, there is a rule that says DST started in 1945 on<br>
Aug 14 at 23:00; however, my tests in Java indicate that DST was observed from<br>
Feb 9 1942 through Sep 30 1945, continuously. The latter matches the historical<br>
information I&#39;ve found. Is this rule superfluous?<br>
<br>
Again, any tips would be appreciated.<br>
<br>
--Chad Eberle<br>
<br>
<br>
</blockquote></div><br>
</div></div></blockquote></div><br></div>