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 day
  • hl3k β€” Hl. 3 Koenige Β· Epiphany
  • weib β€” Weiberfastnacht Β· Fat Thursday
  • romo β€” Rosenmontag Β· Carnival monday
  • fadi β€” Faschingsdienstag Β· Shrove tuesday
  • asmi β€” Aschermittwoch Β· Ash wednesday
  • frau β€” Internationaler Frauentag Β· International Women's day
  • befr β€” Tag der Befreiung Β· Liberation day
  • grdo β€” Gruendonnerstag Β· Maundy Thursday
  • karf β€” Karfreitag Β· Good friday
  • kars β€” Karsamstag Β· Holy Saturday
  • osts β€” Ostersonntag Β· Easter sunday
  • ostm β€” Ostermontag Β· Easter monday
  • pfis β€” Pfingstsonntag Β· Whit sunday
  • pfim β€” Pfingstmontag Β· Whit monday
  • himm β€” Himmelfahrtstag Β· Ascension day
  • fron β€” Fronleichnam Β· Corpus christi
  • 1mai β€” Maifeiertag Β· Labor day, German style
  • 17ju β€” Tag der deutschen Einheit Β· Reunion day (>= 1954, <= 1990)
  • frie β€” Augsburger Friedensfest Β· Augsburg peace day
  • mari β€” Mariae Himmelfahrt Β· Assumption day
  • kind β€” Weltkindertag Β· International Childrens Day
  • 3okt β€” Tag der deutschen Einheit Β· Reunion day (>= 1990)
  • refo β€” Reformationstag Β· Reformation day
  • alhe β€” Allerheiligen Β· All hallows day
  • buss β€” Buss- und Bettag Β· Penance day
  • votr β€” Volkstrauertag Β· Remembrance Day, German Style
  • toso β€” Totensonntag Β· Sunday in commemoration of the dead
  • adv1 β€” 1. Advent Β· 1st sunday in advent
  • adv2 β€” 2. Advent Β· 2nd sunday in advent
  • adv3 β€” 3. Advent Β· 3rd sunday in advent
  • adv4 β€” 4. Advent Β· 4th sunday in advent
  • heil β€” Heiligabend Β· Christmas eve
  • wei1 β€” 1. Weihnachtstag Β· Christmas
  • wei2 β€” 2. Weihnachtstag Β· Christmas
  • silv β€” 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-Wuerttemberg
  • by β€” Freistaat Bayern
  • be β€” Berlin
  • bb β€” Brandenburg
  • hb β€” Freie Hansestadt Bremen
  • hh β€” Freie und Hansestadt Hamburg
  • he β€” Hessen
  • mv β€” Mecklenburg-Vorpommern
  • ni β€” Niedersachsen
  • nw β€” Nordrhein-Westfalen
  • rp β€” Rheinland-Pfalz
  • sl β€” Saarland
  • sn β€” Freistaat Sachsen
  • st β€” Sachsen-Anhalt
  • sh β€” Schleswig-Holstein
  • th β€” 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