DE(3pm)
π DE(3pm) β like, the German holidays module bestie π
okay so this is Date::Holidays::DE, a page from the User Contributed Perl Documentation section of the manual. buckle up, we're doing holidays now. π
β¨ NAME β¨
Date::Holidays::DE β bestie, it determines German holidays. that's the whole job. π©πͺ
πΈ SYNOPSIS πΈ
use Date::Holidays::DE qw(holidays);
my $feiertage_ref = holidays();
my @feiertage = @$feiertage_ref;
π¦ DESCRIPTION π¦
This module exports a single function named holidays() which returns a list of German holidays in a given year. one function. that's it. she's lowkey minimal and we respect that. π
π KNOWN HOLIDAYS π
The module knows about the following holidays β and yes, we're listing all of them, no skipping:
neujβ Neujahr Β· New Year's dayhl3kβ Hl. 3 Koenige Β· Epiphanyweibβ Weiberfastnacht Β· Fat Thursdayromoβ Rosenmontag Β· Carnival mondayfadiβ Faschingsdienstag Β· Shrove tuesdayasmiβ Aschermittwoch Β· Ash wednesdayfrauβ Internationaler Frauentag Β· International Women's daybefrβ Tag der Befreiung Β· Liberation daygrdoβ Gruendonnerstag Β· Maundy Thursdaykarfβ Karfreitag Β· Good fridaykarsβ Karsamstag Β· Holy Saturdayostsβ Ostersonntag Β· Easter sundayostmβ Ostermontag Β· Easter mondaypfisβ Pfingstsonntag Β· Whit sundaypfimβ Pfingstmontag Β· Whit mondayhimmβ Himmelfahrtstag Β· Ascension dayfronβ Fronleichnam Β· Corpus christi1maiβ Maifeiertag Β· Labor day, German style17juβ Tag der deutschen Einheit Β· Reunion day (>= 1954, <= 1990)frieβ Augsburger Friedensfest Β· Augsburg peace daymariβ Mariae Himmelfahrt Β· Assumption daykindβ Weltkindertag Β· International Childrens Day3oktβ Tag der deutschen Einheit Β· Reunion day (>= 1990)refoβ Reformationstag Β· Reformation dayalheβ Allerheiligen Β· All hallows daybussβ Buss- und Bettag Β· Penance dayvotrβ Volkstrauertag Β· Remembrance Day, German Styletosoβ Totensonntag Β· Sunday in commemoration of the deadadv1β 1. Advent Β· 1st sunday in adventadv2β 2. Advent Β· 2nd sunday in adventadv3β 3. Advent Β· 3rd sunday in adventadv4β 4. Advent Β· 4th sunday in adventheilβ Heiligabend Β· Christmas evewei1β 1. Weihnachtstag Β· Christmaswei2β 2. Weihnachtstag Β· Christmassilvβ Silvester Β· New year's eve
Please refer to the module source for detailed information about how every holiday is calculated. Too much detail would be far beyond the scope of this document, but it's not particularly hard once you've found the date for Easter. π£ (fr fr, once you've got Easter everything else just falls out, iykyk)
π USAGE π
π OUTPUT FORMAT π
The list returned by holidays() consists of UNIX-Style timestamps in seconds since The Epoch. You may pass a strftime() style format string to get the dates in any format you desire:
my $feiertage_ref = holidays(FORMAT=>"%d.%m.%Y");
Here are a few examples to get you started:
FORMAT=>"%d.%m.%Y" 25.12.2001
FORMAT=>"%Y%m%d" 20011225
FORMAT=>"%a, %B %d" Tuesday, December 25
Please consult the manual page of strftime() for a complete list of available format definitions. π
There is, however, one "proprietary" extension to the formats of strftime(): the format definition %# will print the internal abbreviation used for each holiday.
FORMAT=>"%#:%d.%m" wei1:25.12.
As the module doesn't want to deal with i18n issues, you'll have to find your own way to translate the aliases into your local language. See the example/feiertage.pl script included in the distribution to get the idea. This was added in version 0.6. β¨
π§ LOCAL HOLIDAYS π§
The module also knows about different regulations throughout Germany. (the vibe check differs by state, obviously)
When calling holidays(), the resulting list by default contains the list of Germany-wide holidays.
You can specify one ore more of the following federal states to get the list of holidays local to that state:
bwβ Baden-Wuerttembergbyβ Freistaat Bayernbeβ Berlinbbβ Brandenburghbβ Freie Hansestadt Bremenhhβ Freie und Hansestadt Hamburgheβ Hessenmvβ Mecklenburg-Vorpommernniβ Niedersachsennwβ Nordrhein-Westfalenrpβ Rheinland-Pfalzslβ Saarlandsnβ Freistaat Sachsenstβ Sachsen-Anhaltshβ Schleswig-Holsteinthβ Freistaat Thueringen
For example,
my $feiertage_ref = holidays(WHERE=>['by', 'bw']);
returns the list of holidays local to Bayern or Baden-Wuerttemberg.
To get the list of local holidays along with the default list of common German holidays, use the following:
my $feiertage_ref = holidays(WHERE=>['common', 'bw']);
returns the list of common German holidays merged with the list of holidays specific to Baden-Wuerttemberg. π«Ά
You can also request a list containing all holidays this module knows about:
my $feiertage_ref = holidays(WHERE=>['all']);
will return a list of all known holidays. This was added in version 0.6.
π ADDITIONAL HOLIDAYS π
There are a number of holidays that aren't <i>really</i> holidays, e.g. New Year's Eve and Christmas Eve. These aren't contained in the common set of holidays returned by the holidays() function. The aforementioned silv and heil are probably the most likely ones that you'll need. If you live in Koeln, you'll probably want to include romo and fadi, too. ;-) π
As if things weren't bad enough already, there even are Holidays that aren't valid in an entire state. This refers to fron, alhe and mari in particular. π
If you want one or several of them to appear in the output from holidays(), use the following:
my $feiertage_ref = holidays(ADD=>['heil', 'silv']);
π SPECIFYING THE YEAR π
By default, holidays() returns the holidays for the current year. Specify a year as follows:
my $feiertage_ref = holidays(YEAR=>2004);
π HOLIDAYS ON WEEKENDS π
By default, holidays() includes Holidays that occur on weekends in its listing.
To disable this behaviour, set the WEEKENDS option to 0:
my $feiertage_ref = holidays(WEEKENDS=>0);
π₯ COMPLETE EXAMPLE π₯
Get all holidays for Germany and Bayern in 2004, count New Year's Eve and Christmas Eve as Holidays. Also, we live in a catholic region where Assumption day is a holiday, too. Exclude weekends and return the date list in human readable format:
my $feiertage_ref = holidays( WHERE => ['common', 'he'],
FORMAT => "%a, %d.%m.%Y",
WEEKENDS => 0,
YEAR => 2004,
ADD => ['heil', 'silv', 'mari']);
β PREREQUISITES β
Uses Date::Calc 5.0 for all calculations. Makes use of the POSIX and Time::Local modules from the standard Perl distribution.
π BUGS & SUGGESTIONS π
If you run into a miscalculation, need some sort of feature or an additional holiday, or if you know of any new changes to our funky holiday situation, please drop the author a note. π¬
Patches are welcome. If you can, please fork the project on github to submit your change:
http://github.com/mschmitt/Date-Holidays-DE
β οΈ Tag der Deutschen Einheit was moved from June 17th to October 3rd in 1990 and is therefore listed twice when calculating holidays for 1990. This is not a bug. Awareness for this was introduced in Version 1.1.
π OFFICIAL HOLIDAY INFORMATION π
The German Federal Ministry of the Interior used to publish a comprehensive list of holiday dates. This does currently not appear to be the case. π (rip to that list, gone but not forgotten)
πΈ LIMITATIONS πΈ
Date::Calc works with year, month and day numbers exclusively. Even though this module uses Date::Calc for all calculations, it represents the calculated holidays as UNIX timestamps (seconds since The Epoch) to allow for more flexible formatting. On Perl versions earlier than 5.12.0 (released 2010), this limits the range of years to work on to the years from 1972 to 2037.
Historic regulations for Buss- und Bettag are still not implemented. π
Date::Holidays::DE is not configurable. Holiday changes don't come over night and a new module release can be rolled out within a single day. π
π AUTHOR π
Martin Schmitt <mas at scsy dot de>
π¦ SEE ALSO π¦
perl, Date::Calc.
okay bestie that's the whole page, you ate that π«Ά β this was perl v5.40.1, dated 2025-05-11, and it's the DE(3pm) page from User Contributed Perl Documentation. go forth and never miss a Feiertag again. periodt. ππ
π¦ where this page comes from
- debian trixie: libdate-holidays-de-perl 2.07-1 Β· ISC
- ubuntu resolute: libdate-holidays-de-perl 2.07-1 Β· ISC
- ubuntu stonking: libdate-holidays-de-perl 2.07-1 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms