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