Admin's avatar

News About Brazilian Time Zone and Daylight Saving Time

Worm.sh # News About Brazilian Time Zone and Daylight Saving Time - Joner Cyrre Worm

paper-boy illustration

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 and forget about updates on configuration files!

Decree tries to establish a general rule:

Little Prince's KingOn August, 28th of 2008, the Brazilian Government has decreed a general rule* to determine the Daylight Saving Time, 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:

  • Zoneinfo files: “Brazil/East”, “America/Sao_Paulo” (GMT-3):
    • Distrito Federal
    • Espírito Santo
    • Goiás
    • Minas Gerais
    • Paraná
    • Rio de Janeiro
    • Rio Grande do Sul
    • Santa Catarina
    • São Paulo
  • Zoneinfo files: Brazil/West, America/Amazonas (GMT-4):
    • Mato Grosso
    • Mato Grosso do Sul

This means that configuration files of time zone have to be set to different configuration for the following States:

  • Zoneinfo files: “Brazil/East”, “America/Sao_Paulo” (GMT-3):
    • Alagoas
    • Amapá
    • Bahia
    • Ceará
    • Maranhão
    • Pará
    • Paraíba
    • Pernambuco
    • Piauí
    • Rio Grande do Norte
    • Sergipe
    • Tocantins
  • Zoneinfo files: Brazil/West, America/Amazonas (GMT-4):
    • Acre
    • Amazonas
    • Rondônia
    • Roraima

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 previous decree.

* Read the english translation of the decree (Google® translation tool).

In short: the general rule:

  • Begins on the 3rd Sunday of October, at zero hour (saturday’s midnight), shifts one hour ahead, loosing an hour.
  • Ends on the 3rd Sunday of February, at zero hour (saturday’s midnight), shifts one hour back, gaining that lost hour back.

Now, in GNU/Linux, this can be coded as a rule in the configuration of the time zone file for “Brazil/East” (only on those States mentioned on the decree):

Rule Brazil 2008 max - Oct thirdSun 00:00s 1:00 S
Rule Brazil 2009 max - Feb thirdSun 00:00s 0 -

The Mess-Up

King MomusThat could have been perfect, if not for one detail: The Carnival Sunday!

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?

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.

Bringing Order to Chaos

When does Carnival occur?

Devil tempting JesusCarnival has a relation to a Christian religious tradition, Lent, that is the 40 day period preceding Easter Day. The first day of Lent is called “Ash Wednesday”. Sundays are excluded from these 40 days, because they are considered “Pascal Sundays”. 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.

When does Easter occur?

Empty ThombEaster Day celebrates the resurrection of Jesus Christ and is based on an old and complex calculation: The Computus. It is a conversion of the Gregorian Calendar taking into consideration Moon phases and Vernal Equinox. According to The Computus,“…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.”

How to put it together?

Eureka!The Carnival occurs before Ash Wednesday, so it’s always Tuesday. So all you have to do is go back 49 days from Easter Day:

  • 40 days of Lent.
  • 6 Pascal Sundays.
  • 3 days from Ash Wednesday to Carnival Sunday.

Now check if it matches DST ending date. If so, put DST ending 7 days later.

For example: Easter is celebrated on Apr, 8th of 2012.

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:

Rule Brazil 2012 only - Feb 26 0:00 0 -

Is there a way to avoid annual changes in time zone?

Halleluja!Hallelujah! Yes! Get my Bash script and it will generate all exception rules till the end of times, so that you compile Brazil/East time zone file only once!

PS: The english discourse has been crafted to produce the least nonsensical output from Google Translation Tool.


Tags: , , , , ,

Leave a Reply

Copyright © 2008 - 2010 by Joner Cyrre Worm.   License: Creative Commons License (en_US) Licença Creative Commons (pt_BR)
Theme "Worm.SH DS" © 2009 Joner Cyrre Worm.   Restylished from "Dark Strict" theme from ATILLUS design studio.   License: Creative Commons License (en_US) Licença Creative Commons (pt_BR)
Powered by Wordpress Blog Software