1DE(3) User Contributed Perl Documentation DE(3)
2
3
4
6 Date::Holidays::DE - Determine German holidays
7
9 use Date::Holidays::DE qw(holidays);
10 my $feiertage_ref = holidays();
11 my @feiertage = @$feiertage_ref;
12
14 This module exports a single function named holidays() which returns a
15 list of German holidays in a given year.
16
18 The module knows about the following holidays:
19
20 neuj Neujahr New Year's day
21 hl3k Hl. 3 Koenige Epiphany
22 weib Weiberfastnacht Fat Thursday
23 romo Rosenmontag Carnival monday
24 fadi Faschingsdienstag Shrove tuesday
25 asmi Aschermittwoch Ash wednesday
26 frau Internationaler Frauentag International Women's day
27 befr Tag der Befreiung Liberation day
28 grdo Gruendonnerstag Maundy Thursday
29 karf Karfreitag Good friday
30 kars Karsamstag Holy Saturday
31 osts Ostersonntag Easter sunday
32 ostm Ostermontag Easter monday
33 pfis Pfingstsonntag Whit sunday
34 pfim Pfingstmontag Whit monday
35 himm Himmelfahrtstag Ascension day
36 fron Fronleichnam Corpus christi
37 1mai Maifeiertag Labor day, German style
38 17ju Tag der deutschen Einheit Reunion day (>= 1954, <= 1990)
39 frie Augsburger Friedensfest Augsburg peace day
40 mari Mariae Himmelfahrt Assumption day
41 kind Weltkindertag International Childrens Day
42 3okt Tag der deutschen Einheit Reunion day (>= 1990)
43 refo Reformationstag Reformation day
44 alhe Allerheiligen All hallows day
45 buss Buss- und Bettag Penance day
46 votr Volkstrauertag Remembrance Day, German Style
47 toso Totensonntag Sunday in commemoration of the dead
48 adv1 1. Advent 1st sunday in advent
49 adv2 2. Advent 2nd sunday in advent
50 adv3 3. Advent 3rd sunday in advent
51 adv4 4. Advent 4th sunday in advent
52 heil Heiligabend Christmas eve
53 wei1 1. Weihnachtstag Christmas
54 wei2 2. Weihnachtstag Christmas
55 silv Silvester New year's eve
56
57 Please refer to the module source for detailed information about how
58 every holiday is calculated. Too much detail would be far beyond the
59 scope of this document, but it's not particularly hard once you've
60 found the date for Easter.
61
63 OUTPUT FORMAT
64 The list returned by holidays() consists of UNIX-Style timestamps in
65 seconds since The Epoch. You may pass a strftime() style format string
66 to get the dates in any format you desire:
67
68 my $feiertage_ref = holidays(FORMAT=>"%d.%m.%Y");
69
70 Here are a few examples to get you started:
71
72 FORMAT=>"%d.%m.%Y" 25.12.2001
73 FORMAT=>"%Y%m%d" 20011225
74 FORMAT=>"%a, %B %d" Tuesday, December 25
75
76 Please consult the manual page of strftime() for a complete list of
77 available format definitions.
78
79 There is, however, one "proprietary" extension to the formats of
80 strftime(): The format definition %# will print the internal
81 abbreviation used for each holiday.
82
83 FORMAT=>"%#:%d.%m" wei1:25.12.
84
85 As the module doesn't want to deal with i18n issues, you'll have to
86 find your own way to translate the aliases into your local language.
87 See the example/feiertage.pl script included in the distribution to get
88 the idea. This was added in version 0.6.
89
90 LOCAL HOLIDAYS
91 The module also knows about different regulations throughout Germany.
92
93 When calling holidays(), the resulting list by default contains the
94 list of Germany-wide holidays.
95
96 You can specify one ore more of the following federal states to get the
97 list of holidays local to that state:
98
99 bw Baden-Wuerttemberg
100 by Freistaat Bayern
101 be Berlin
102 bb Brandenburg
103 hb Freie Hansestadt Bremen
104 hh Freie und Hansestadt Hamburg
105 he Hessen
106 mv Mecklenburg-Vorpommern
107 ni Niedersachsen
108 nw Nordrhein-Westfalen
109 rp Rheinland-Pfalz
110 sl Saarland
111 sn Freistaat Sachsen
112 st Sachsen-Anhalt
113 sh Schleswig-Holstein
114 th Freistaat Thueringen
115
116 For example,
117
118 my $feiertage_ref = holidays(WHERE=>['by', 'bw']);
119
120 returns the list of holidays local to Bayern or Baden-Wuerttemberg.
121
122 To get the list of local holidays along with the default list of common
123 German holidays, use the following:
124
125 my $feiertage_ref = holidays(WHERE=>['common', 'bw']);
126
127 returns the list of common German holidays merged with the list of
128 holidays specific to Baden-Wuerttemberg.
129
130 You can also request a list containing all holidays this module knows
131 about:
132
133 my $feiertage_ref = holidays(WHERE=>['all']);
134
135 will return a list of all known holidays. This was added in version
136 0.6.
137
138 ADDITIONAL HOLIDAYS
139 There are a number of holidays that aren't really holidays, e.g. New
140 Year's Eve and Christmas Eve. These aren't contained in the common set
141 of holidays returned by the holidays() function. The aforementioned
142 silv and heil are probably the most likely ones that you'll need. If
143 you live in Koeln, you'll probably want to include romo and fadi, too.
144 ;-)
145
146 As if things weren't bad enough already, there even are Holidays that
147 aren't valid in an entire state. This refers to fron, alhe and mari in
148 particular.
149
150 If you want one or several of them to appear in the output from
151 holidays(), use the following:
152
153 my $feiertage_ref = holidays(ADD=>['heil', 'silv']);
154
155 SPECIFYING THE YEAR
156 By default, holidays() returns the holidays for the current year.
157 Specify a year as follows:
158
159 my $feiertage_ref = holidays(YEAR=>2004);
160
161 HOLIDAYS ON WEEKENDS
162 By default, holidays() includes Holidays that occur on weekends in its
163 listing.
164
165 To disable this behaviour, set the WEEKENDS option to 0:
166
167 my $feiertage_ref = holidays(WEEKENDS=>0);
168
170 Get all holidays for Germany and Bayern in 2004, count New Year's Eve
171 and Christmas Eve as Holidays. Also, we live in a catholic region where
172 Assumption day is a holiday, too. Exclude weekends and return the date
173 list in human readable format:
174
175 my $feiertage_ref = holidays( WHERE => ['common', 'he'],
176 FORMAT => "%a, %d.%m.%Y",
177 WEEKENDS => 0,
178 YEAR => 2004,
179 ADD => ['heil', 'silv', 'mari']);
180
182 Uses Date::Calc 5.0 for all calculations. Makes use of the POSIX and
183 Time::Local modules from the standard Perl distribution.
184
186 If you run into a miscalculation, need some sort of feature or an
187 additional holiday, or if you know of any new changes to our funky
188 holiday situation, please drop the author a note.
189
190 Patches are welcome. If you can, please fork the project on github to
191 submit your change:
192
193 http://github.com/mschmitt/Date-Holidays-DE
194
195 Tag der Deutschen Einheit was moved from June 17th to October 3rd in
196 1990 and is therefore listed twice when calculating holidays for 1990.
197 This is not a bug. Awareness for this was introduced in Version 1.1.
198
200 The German Federal Ministry of the Interior used to publish a
201 comprehensive list of holiday dates. This does currently not appear to
202 be the case.
203
205 Date::Calc works with year, month and day numbers exclusively. Even
206 though this module uses Date::Calc for all calculations, it represents
207 the calculated holidays as UNIX timestamps (seconds since The Epoch) to
208 allow for more flexible formatting. On Perl versions earlier than
209 5.12.0 (released 2010), this limits the range of years to work on to
210 the years from 1972 to 2037.
211
212 Historic regulations for Buss- und Bettag are still not implemented.
213
214 Date::Holidays::DE is not configurable. Holiday changes don't come over
215 night and a new module release can be rolled out within a single day.
216
218 Martin Schmitt <mas at scsy dot de>
219
221 perl, Date::Calc.
222
223
224
225perl v5.32.0 2020-07-28 DE(3)