<?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>Worm.sh # Joner Cyrre Worm - Free Software Advocate, Perl Developer and CPAN Contributor &#187; horário de verão</title>
	<atom:link href="http://www.worm.sh/tag/horario-de-verao/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.worm.sh</link>
	<description>Free Software Advocate, Perl Developer and CPAN Contributor</description>
	<lastBuildDate>Thu, 15 Dec 2011 16:03:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>News About Brazilian Time Zone and Daylight Saving Time</title>
		<link>http://www.worm.sh/2008/09/news-about-brazilian-time-zone-and-daylight-saving-time/</link>
		<comments>http://www.worm.sh/2008/09/news-about-brazilian-time-zone-and-daylight-saving-time/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 14:31:25 +0000</pubDate>
		<dc:creator>worm</dc:creator>
				<category><![CDATA[Free Software]]></category>
		<category><![CDATA[daylight saving]]></category>
		<category><![CDATA[DST]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[horário de verão]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://worm.x10hosting.com/worm.sh/?p=44</guid>
		<description><![CDATA[Good news: Brazilian Daylight Saving Time now has a fixed rule. It affects the configuration files of time zones . Bad news: The new rule for DST has an exception when it ends on Carnival sundays. Oh, no! More exceptions! Really Good news: Get my Bash script to generate exception rules for Brazilian time zones [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-45" style="border: 0pt none; margin: 4px;" title="News!" src="/wp-content/uploads/jornaleiro-full.jpg" alt="paper-boy illustration" width="100" height="138" /></p>
<p><strong>Good news:</strong> Brazilian Daylight Saving Time now has a fixed rule. It affects the configuration files of time zones .</p>
<p><strong>Bad news:</strong> The new rule for DST has an exception when it ends on Carnival sundays. Oh, no! More exceptions!</p>
<p><strong>Really Good news: </strong><a title="Brazil DST carnival fix script" href="http://code.google.com/p/buncha-toolz/wiki/BRST_CARNIVAL_FIX_Documentation" target="_blank">Get my Bash script</a> to generate exception rules for Brazilian time zones and forget about updates on configuration files!</p>
<p><span id="more-44"></span></p>
<h3><span><strong><strong>Decree tries to establish a general rule: </strong></strong></span></h3>
<p><a title="Little Prince's Wikipedia Article" href="http://en.wikipedia.org/wiki/The_Little_Prince" target="_blank"><img class="alignright size-full wp-image-48" style="border: 0pt none; margin: 4px;" title="Little Prince's King" src="/wp-content/uploads/king-medium.jpg" alt="Little Prince's King" width="156" height="200" /></a>On August, 28th of 2008, the Brazilian Government has decreed a <a href="https://www.planalto.gov.br/ccivil_03/_ato2007-2010/2008/decreto/d6558.htm">general rule</a><sup>*</sup> to determine the <a href="http://en.wikipedia.org/wiki/Daylight_saving">Daylight Saving Time</a>, almost putting an end to the much criticized tradition (specially by IT pros) of annual decrees to establish different beginning and ending dates for the period where time is adjusted to obtain energy savings. According to the decree, the following States are subject to DST:</p>
<ul>
<li><span style="font-size: xx-small;"><a href="http://en.wikipedia.org/wiki/Zoneinfo">Zoneinfo</a> files: &#8220;Brazil/East&#8221;, &#8220;America/Sao_Paulo&#8221; (GMT-3):</span>
<ul>
<li><span style="font-size: xx-small;">Distrito Federal</span></li>
<li><span style="font-size: xx-small;">Espírito Santo</span></li>
<li><span style="font-size: xx-small;">Goiás</span></li>
<li><span style="font-size: xx-small;">Minas Gerais</span></li>
<li><span style="font-size: xx-small;">Paraná</span></li>
<li><span style="font-size: xx-small;">Rio de Janeiro</span></li>
<li><span style="font-size: xx-small;">Rio Grande do Sul</span></li>
<li><span style="font-size: xx-small;">Santa Catarina</span></li>
<li><span style="font-size: xx-small;">São Paulo</span></li>
</ul>
</li>
<li><span style="font-size: xx-small;">Zoneinfo files: </span><span style="font-size: xx-small;">Brazil/West, America/Amazonas (GMT-4):</span>
<ul>
<li><span style="font-size: xx-small;">Mato Grosso<br />
</span></li>
<li><span style="font-size: xx-small;">Mato Grosso do Sul</span></li>
</ul>
</li>
</ul>
<p>This means that configuration files of time zone have to be set to different configuration for the following States:</p>
<ul>
<li><span style="font-size: xx-small;">Zoneinfo files: &#8220;Brazil/East&#8221;, &#8220;America/Sao_Paulo&#8221; (GMT-3):</span>
<ul>
<li><span style="font-size: xx-small;">Alagoas</span></li>
<li><span style="font-size: xx-small;">Amapá</span></li>
<li><span style="font-size: xx-small;">Bahia</span></li>
<li><span style="font-size: xx-small;">Ceará</span></li>
<li><span style="font-size: xx-small;">Maranhão</span></li>
<li><span style="font-size: xx-small;">Pará</span></li>
<li><span style="font-size: xx-small;">Paraíba</span></li>
<li><span style="font-size: xx-small;">Pernambuco</span></li>
<li><span style="font-size: xx-small;">Piauí</span></li>
<li><span style="font-size: xx-small;">Rio Grande do Norte</span></li>
<li><span style="font-size: xx-small;">Sergipe</span></li>
<li><span style="font-size: xx-small;">Tocantins</span></li>
</ul>
</li>
<li><span style="font-size: xx-small;">Zoneinfo files: </span><span style="font-size: xx-small;">Brazil/West, America/Amazonas (GMT-4):</span>
<ul>
<li><span style="font-size: xx-small;">Acre</span></li>
<li><span style="font-size: xx-small;">Amazonas</span></li>
<li><span style="font-size: xx-small;">Rondônia</span></li>
<li><span style="font-size: xx-small;">Roraima</span></li>
</ul>
</li>
</ul>
<p>Note that the States included on the DST concentrate the vast majority of the population and IT resources, and also that time zones were changed by a <a href="http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Lei/L11662.htm">previous decree</a>.</p>
<p><em><span style="font-size: xx-small;"><sup>*</sup> Read the <a href="http://translate.google.com/translate?u=http%3A%2F%2Fwww.planalto.gov.br%2Fccivil_03%2F_ato2007-2010%2F2008%2Fdecreto%2Fd6558.htm&amp;hl=en&amp;ie=UTF-8&amp;sl=pt&amp;tl=en">english translation</a> of the decree (Google<span style="font-size: x-small;">®</span> translation tool).</span></em></p>
<p><em><span style="font-size: xx-small;"> </span></em></p>
<h4>In short: the general rule:</h4>
<ul>
<li><strong>Begins</strong> on the 3rd Sunday of October, at zero hour (saturday&#8217;s midnight), shifts one hour ahead, loosing an hour.</li>
<li><strong>Ends</strong> on the 3rd Sunday of February, at zero hour (saturday&#8217;s midnight), shifts one hour back, gaining that lost hour back.</li>
</ul>
<p>Now, in GNU/Linux, this can be coded as a rule in the configuration of the time zone file for &#8220;Brazil/East&#8221;<span style="font-size: xx-small;"> (only on those States mentioned on the decree)</span>:</p>
<pre style="color: #000000; font-family: courier new,monospace; background-color: #009900;"><strong>Rule Brazil 2008 max - Oct thirdSun 00:00s 1:00 S</strong></pre>
<pre style="color: #000000; font-family: courier new,monospace; background-color: #009900;"><strong>Rule Brazil 2009 max - Feb thirdSun 00:00s 0 -
</strong></pre>
<h4>The Mess-Up</h4>
<p><a title="King Momus' Wikipedia Article" href="http://en.wikipedia.org/wiki/Momus" target="_blank"><img class="alignleft size-full wp-image-49" style="border: 0pt none; margin: 4px;" title="King Momus" src="/wp-content/uploads/reimomo-medium.jpg" alt="King Momus" width="77" height="85" /></a>That could have been perfect, if not for one detail: <strong>The Carnival Sunday</strong>!</p>
<p>Yes, as many of you know, brazilians love Carnival, and all those gorgeous parades. Those are really serious stuff for many people there. And imagine what would happen if suddenly, during one parade you could have an extra hour to do the samba?</p>
<p>As ridiculous as it may seem, the decree cites an exception, when the end of DST coincides with the Carnival Sunday, which is in the middle of a 4 day-and-a-half holiday! In this case, DST ends on the following Sunday.</p>
<h3><strong>Bringing Order to Chaos</strong></h3>
<h4>When does Carnival occur?</h4>
<p><a title="Temptation of Christ's Wikipedia article" href="http://en.wikipedia.org/wiki/Temptation_of_Christ" target="_blank"><img class="alignright size-full wp-image-51" style="border: 0pt none; margin: 4px;" title="Devil tempting Jesus" src="/wp-content/uploads/jesus_n_devil-custom.jpg" alt="Devil tempting Jesus" width="71" height="100" /></a>Carnival has a relation to a Christian religious tradition, <a href="http://en.wikipedia.org/wiki/Lent">Lent</a>, that is the 40 day period preceding <a href="http://en.wikipedia.org/wiki/Easter">Easter</a> Day. The first day of Lent is called <em>&#8220;Ash Wednesday&#8221;</em>. Sundays are excluded from these 40 days, because they are considered <em>&#8220;Pascal Sundays&#8221;</em>. During this period, people should do the fasting and pray (refrain from eating meat, celebrating and other stuff). So, to get prepared to those 40 days, people set up to a big party: Carnival! This way, Carnival Day is directly dependent on Easter Day.</p>
<h4>When does Easter occur?</h4>
<p><a title="Empty tomb's Wikipedia article" href="http://en.wikipedia.org/wiki/Empty_tomb" target="_blank"><img class="alignleft size-full wp-image-52" style="border: 0pt none; margin: 4px;" title="Empty Tomb" src="/wp-content/uploads/sefoi-custom.jpg" alt="Empty Thomb" width="80" height="100" /></a>Easter Day celebrates the resurrection of Jesus Christ and is based on an old and complex calculation: The <em><a href="http://en.wikipedia.org/wiki/Computus">Computus</a></em>. It is a conversion of the Gregorian Calendar taking into consideration <a href="http://en.wikipedia.org/wiki/Moon_calendar">Moon phases</a> and <a href="http://en.wikipedia.org/wiki/Vernal_equinox">Vernal Equinox</a>. According to The <em>Computus</em>,<em>&#8220;&#8230;Easter Sunday is the Sunday following the Paschal Full Moon date. The Paschal Full Moon date is the Ecclesiastical Full Moon date following 20 March.&#8221;</em></p>
<h4>How to put it together?</h4>
<p><a title="Eureka greek word's Wikipedia article" href="http://en.wikipedia.org/wiki/Eureka_(word)" target="_blank"><img class="alignright size-full wp-image-53" style="border: 0pt none; margin: 4px;" title="Eureka!" src="/wp-content/uploads/eureka-small.jpg" alt="Eureka!" width="96" height="91" /></a>The Carnival occurs before Ash Wednesday, so it&#8217;s always Tuesday. So all you have to do is go back 49 days from Easter Day:</p>
<ul>
<li>40 days of Lent.</li>
<li>6 Pascal Sundays.</li>
<li>3 days from Ash Wednesday to Carnival Sunday.</li>
</ul>
<p>Now check if it matches DST ending date. If so, put DST ending 7 days later.</p>
<p>For example: Easter is celebrated on Apr, 8th of 2012.</p>
<p>Carnival Sunday is celebrated on Feb, 19th, which is the 3rd Sunday and coincides with the last day of DST. Hence there has to be an exception time zone rule to postpone it to the next Sunday:</p>
<pre style="color: #006600; font-family: courier new,monospace; background-color: #009900;"><strong style="color: #000000;">Rule Brazil 2012 only - Feb 26 0:00 0 -</strong></pre>
<h4>Is there a way to avoid annual changes in time zone?</h4>
<p><a title="Halleluja hebrew word's Wikipedia article" href="http://en.wikipedia.org/wiki/Hallelujah" target="_blank"><img class="alignleft size-full wp-image-54" style="border: 0pt none; margin: 4px;" title="Halleluja!" src="/wp-content/uploads/angel2-small.jpg" alt="Halleluja!" width="96" height="59" /></a>Hallelujah! Yes! <strong> </strong><a title="Brazil DST carnival fix script" href="http://code.google.com/p/buncha-toolz/wiki/BRST_CARNIVAL_FIX_Documentation" target="_blank">Get my Bash script</a> and it will generate all exception rules till the end of times, so that you compile Brazil/East time zone file only once!</p>
<p style="color: #E67300; background-color: #333333; text-align: center;"><span style="font-size: xx-small;"><em><strong style="font-family: times new roman,serif;">PS: The english discourse has been crafted to produce the least nonsensical output from Google Translation Tool.</strong></em></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.worm.sh/2008/09/news-about-brazilian-time-zone-and-daylight-saving-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

