Date::Holidays::NZ is a Perl module that determines whether a given date is a New Zealand public holiday or not.Determines
As described at http://www.ers.dol.govt.nz/holidays_act_2003/dates/, the system of determining holidays in New Zealand is a complicated matter. Not only do you need to know what region the country is living in to figure out the relevant Anniversary Day, but sometimes the district too (for the West Coast and Canterbury). As regions are free to pick the actual days observed for particular holidays, this module cannot guarantee dates past the last time it was checked against the Employment Relations Service web site (currently returns known good values for statutory holidays 2003 - 2009 and regional holidays for 2005).
This module hopes to return values that are Mostly Right(tm) when passed in census 2001 region codes (widely used throughout government and industry), and can also be passed in textual region labels, which includes the appropriate Anniversary Day.
Also, there is a difference between what is considered a holiday by the Holidays Act 2003 - and hence entitling a person to time in lieu and/or extra pay - and what is considered to be a Bank Holiday. This module returns Bank Holiday dates, so if Christmas Day falls on a Sunday, the 26th will be called "Boxing Day", and the 27th "Christmas Day Holiday".
my ($year, $month, $day) = (localtime)[ 5, 4, 3 ];
$year += 1900;
$month += 1;
print "Woohoo" if is_nz_holiday( $year, $month, $day );
# supply Census 2001 region codes (1-19), or names like
# "Wellington", "Canterbury (South)", etc
print "Yes!" if is_nz_holiday( $year, $month, $day, $region );
my $h = nz_holidays($year);
printf "Dec. 25th is named '%s'