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