<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>SnippetRepoBrowser</title>
    <link>http://snippet.gnstudio.com/snippetrepobrowser/index</link>    
    <description>RSS Feed of SnippetRepoBrowser (Global RSS)</description>    
    <language>en-us</language>
    <pubDate>Thu, 09 Feb 2012 20:50:52 +0100</pubDate>
    <docs>SnippetRepoBrowser/index</docs>
    <generator>SnippetRepoBrowser Feed Generator</generator>
    <item>
      <title><![CDATA[Detect daily saving times]]></title>
      <link>http://snippet.gnstudio.com/viewtopic/6</link>
      <description><![CDATA[Thanks mainly to the efforts of a London builder named William Willett         we have the controversial notion of daylight saving time (DST). This practice         means that in some locations, all clocks are put one hour ahead of UTC         time during the summer months.<br />Well, if you use local time on your site (in a real time clock for example)         and your site is viewed by someone out with the US, then at certain times         of year the time on your clock will be out by an hour. In the case of         Europe, between the last Sunday in March and the first Sunday in April         the local time on your machine will be one hour ahead of Flash local time. <br />      <br />This small script check the DST accordingly to US convention (first sunday of April last sunday of October) and can be adjusted for your needs in different countires.<br />]]><![CDATA[<div class="divcode"><pre lang="actionscript">var start:Date = new Date()<br />			<br />var startCounter:int = 1;<br />start.setMonth(3, startCounter);<br />			<br />for(var i:int = 0; i &lt; 10; i++){<br />				<br />    startCounter++<br />    start.setMonth(3, startCounter)<br />				<br />    if(start.getDay() == 0){<br />					<br />	 break;<br />					<br />    }<br />				<br />}<br />			<br />var end:Date = new Date();<br />var endCounter:int = 31;<br />			<br />end.setMonth(3, endCounter);<br />			<br />for(var j:int = 0; j &lt; 10; j++){<br />				<br />    endCounter--;<br />    end.setMonth(9, endCounter)<br />				<br />    if(end.getDay() == 0){<br />					<br />        break;<br />					<br />     }<br />				<br />}<br />			<br />trace(&quot;start date&quot;, start)<br />trace(&quot;end date&quot;, end)</pre></div><br /><br />]]></description>
      <author>Giorgio Natili</author>
      <pubDate>Wed, 02 Sep 2009 11:55:06 +0200</pubDate>
      <category>ActionScript</category>
      <guid>http://snippet.gnstudio.com/viewtopic/6</guid>
   </item>
  </channel>
</rss>
