Carnival Sunday in Brazil

Olson, Arthur David (NIH/NCI) [E] olsona at
Mon Sep 22 15:05:54 UTC 2008

	Rule Brazil 2012 only - Feb Sun>=22  0:00 0 -
...does seem preferable to using the actual dates; as Jesper notes, it "will give a hint on how the dates behave after 2038."

Another possibility is to express the rules as...
	Rule Brazil 2008 max earlycarnival Feb Sun>=15 0:00 0 -
	Rule Brazil 2008 max latecarnival  Feb Sun>=22 0:00 0 -
...with suitable additions to the "yearistype" script--including, but not limited to,
		case $1 in
			2012|2015|2023|2026|2034|2037)	late=1 ;;
			*)				late=0 ;;
		case $2-$late in
			earlycarnival-0|latecarnival-1)	exit 0 ;;
			*)				exit 1 ;;
		esac ;;

Yet another possibility is to cobble up a Carnival calculating executable that can be used by yearistype (instead of hard-coding the years as above). Both this approach and the hard-coded approach merit caution: the yearistype mechanism hasn't been used for real-world stuff in some years.

Long term, given the non-repeating nature of Carnival (it's not on a 400-year cycle since it depends on the phase of the moon) it might be best to incorporate the Carnival calculator into localtime; that's a non-trivial endeavor.

For purposes of getting something correct and safe out the door now, I'd go with Jesper's approach.


More information about the tz mailing list