Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 2c44457ebf
Fetching contributors…

Cannot retrieve contributors at this time

executable file 66 lines (59 sloc) 1.862 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
#!/usr/bin/perl -w
use strict;
use warnings;
use Date::Holidays::DE qw(holidays);

# Sample script for Date::Holidays::DE by Martin Schmitt <mas at scsy dot de>

# Assign full names to the internal aliases from Date::Holidays::DE
# See the manpage for a list of all aliases.
my %feiertagsnamen = (
'neuj' => 'Neujahrstag',
'hl3k' => 'Hl. 3 Koenige',
'romo' => 'Rosenmontag',
'fadi' => 'Faschingsdienstag',
'asmi' => 'Aschermittwoch',
'grdo' => 'Gruendonnerstag',
'karf' => 'Karfreitag',
'kars' => 'Karsamstag',
'osts' => 'Ostersonntag',
'ostm' => 'Ostermontag',
'pfis' => 'Pfingstsonntag',
'pfim' => 'Pfingstmontag',
'himm' => 'Himmelfahrtstag',
'fron' => 'Fronleichnam',
'1mai' => 'Maifeiertag',
'17ju' => 'Tag der deutschen Einheit (1954-1990)',
'mari' => 'Mariae Himmelfahrt',
'frie' => 'Augsburger Friedensfest (regional)',
'3okt' => 'Tag der deutschen Einheit',
'refo' => 'Reformationstag',
'alhe' => 'Allerheiligen',
'buss' => 'Buss- und Bettag',
'votr' => 'Volkstrauertag',
'toso' => 'Totensonntag',
'adv1' => '1. Advent',
'adv2' => '2. Advent',
'adv3' => '3. Advent',
'adv4' => '4. Advent',
'heil' => 'Heiligabend',
'wei1' => '1. Weihnachtstag',
'wei2' => '2. Weihnachtstag',
'silv' => 'Silvester'
);
# This year is $dieses
my $dieses = (localtime(time()))[5] + 1900;

# Next year is $naechstes
my $naechstes = $dieses + 1;

# Get the list of holidays for next year
my @feiertage = @{holidays( WHERE => ['all'],
FORMAT => "%#:%d.%m.%Y (%s s since the epoch.)",
YEAR => $naechstes
)};

print "Feiertage fuer $naechstes:\n";
print "--------------------\n";

foreach (@feiertage){
# Split name and date
my ($name, $datum) = split /:/;
# Print name from $feiertagsnamen along with the date
printf ("%-40s: %10s\n", $feiertagsnamen{$name}, $datum);
}

exit 0;
Something went wrong with that request. Please try again.