Leser: 1
|< 1 2 >| | 11 Einträge, 2 Seiten |
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
#!/usr/bin/perl -w
use strict;
use Date::Handler;
my $start_year = 2004;
my $start_month = 9;
my $start_day = 1;
my $end_year = 2006;
my $end_month = 9;
my $end_day = 1;
my $date;
my ($week_day, $year, $month, $day, $max_month, $max_day, $min_month);
my @work_days = ();
for $year ($start_year .. $end_year){
if ( ($year eq $start_year) ){
$min_month = $start_month;
} else {
$min_month = 1;
}
if ( ($year eq $end_year) ){
$max_month = $end_month;
} else {
$max_month = 12;
}
for $month ($min_month .. $max_month){
$date = new Date::Handler({ date => { year => $year, month => $month, day => 0 },});
if ( ($year eq $end_year) && ($month eq $end_month) ){
$max_day = $end_day;
} else {
$max_day = $date->DaysInMonth();
}
for $day ($start_day .. $max_day){
$date = new Date::Handler({ date => { year => $start_year, month => $month, day => $day },});
$week_day = $date->WeekDayName();
push(@work_days, $week_day.';;'.$day.';;'.$month.';;'.$year) unless ( ($week_day eq 'Saturday') || ($week_day eq 'Sunday') );
}
}
}
my @dump= ();
foreach my $work_day (@work_days) {
@dump = split(';;', $work_day);
print "$dump[0]\t$dump[1].$dump[2].$dump[3]\n";
}
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
...
for $year ($start_year .. $end_year){
if ( ($year eq $start_year) ){
$min_month = $start_month;
} else {
$min_month = 1;
}
if ( ($year eq $end_year) ){
$max_month = $end_month;
} else {
$max_month = 12;
}
for $month ($min_month .. $max_month){
$date = new Date::Handler({ date => { year => $year, month => $month, day => 0 },});
if ( ($year eq $start_year) && ($month eq $start_month) ){
$min_day = $start_day;
} else {
$min_day = 1;
}
if ( ($year eq $end_year) && ($month eq $end_month) ){
$max_day = $end_day;
} else {
$max_day = ($date->DaysInMonth());
}
for $day ($start_day .. $max_day){
$date = new Date::Handler({ date => { year => $start_year, month => $month, day => $day },});
$week_day = $date->WeekDayName();
push(@work_days, $week_day.';;'.$day.';;'.$month.';;'.$year) unless ( ($week_day eq 'Saturday') || ($week_day eq 'Sunday') );
}
}
}
...
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/perl -w
use strict;
use Date::Handler;
my $start_year = 2004;
my $start_month = 9;
my $start_day = 1;
my $end_year = 2006;
my $end_month = 9;
my $end_day = 1;
sub get_workdays()
{
my ($week_day, $year, $month, $day, $max_month, $max_day, $min_month, $min_day, $string);
my @work_days = ();
my $date;
for $year ($start_year .. $end_year){
if ( ($year eq $start_year) ){
$min_month = $start_month;
} else {
$min_month = 1;
}
if ( ($year eq $end_year) ){
$max_month = $end_month;
} else {
$max_month = 12;
}
for $month ($min_month .. $max_month){
$date = new Date::Handler({ date => { year => $year, month => $month, day => 0 },});
if ( ($year eq $start_year) && ($month eq $start_month) ){
$min_day = $start_day;
} else {
$min_day = 1;
}
if ( ($year eq $end_year) && ($month eq $end_month) ){
$max_day = $end_day;
} else {
$max_day = ($date->DaysInMonth());
}
for $day ($start_day .. $max_day){
$date = new Date::Handler({ date => { year => $year, month => $month, day => $day },});
$week_day = $date->WeekDayName();
if (&feiertage_bayern($day, $month)){
$string = $week_day.';;'.$day.';;'.$month.';;'.$year.';;'.&feiertage_bayern($day, $month);
} else {
$string = $week_day.';;'.$day.';;'.$month.';;'.$year;
}
push(@work_days, $string) unless ( ($week_day eq 'Saturday') || ($week_day eq 'Sunday') );
}
}
}
return @work_days;
}
sub feiertage_bayern # ($_[0] = $day, $_[1] = $month)
{
my %feiertage=();
# Byerische Feiertage (yearly)
$feiertage{'1.1'}='Neujahr';
$feiertage{'1.5'}='Erster Mai';
$feiertage{'24.12'}='Heilig Abend';
return $feiertage{$_[0].'.'.$_[1]} if ( ($feiertage{$_[0].'.'.$_[1]}) );
return 0;
}
my @dump= ();
my @work_days = &get_workdays();
foreach my $work_day (@work_days) {
@dump = split(';;', $work_day);
if ($dump[4]){
print "$dump[0]\t$dump[1].$dump[2].$dump[3]\tFeiertag: $dump[4]\n";
} else {
print "$dump[0]\t$dump[1].$dump[2].$dump[3]\n";
}
}
Quote\n\nWarning: Failed opening '../connection_data.php3' for inclusion (include_path='.:/usr/share/pear') in /home/jf_jumez/jours-feries.com/html/index.php3 on line 5
Fatal error: Call to undefined function: connection() in /home/jf_jumez/jours-feries.com/html/index.php3 on line 7
|< 1 2 >| | 11 Einträge, 2 Seiten |