2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

95_holiday.pm: search with the right year for yesterday/tomorrow (Forum #117252)

git-svn-id: https://svn.fhem.de/fhem/trunk@23448 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2021-01-01 09:44:07 +00:00
parent ee446614aa
commit a716158b48

View File

@ -310,12 +310,12 @@ holiday_Get($@)
$t += 86400 if($a[1] eq "tomorrow");
$t -= 86400 if($a[1] eq "yesterday");
my @a = localtime($t);
$arg = sprintf("%02d-%02d", $a[4]+1, $a[3]);
$arg = sprintf("%04d-%02d-%02d", $a[5]+1900, $a[4]+1, $a[3]);
} elsif($a[1] eq "days") {
my $t = time() + ($a[2] ? int($a[2]) : 0)*86400;
my @a = localtime($t);
$arg = sprintf("%02d-%02d", $a[4]+1, $a[3]);
$arg = sprintf("%04d-%02d-%02d", $a[5]+1900, $a[4]+1, $a[3]);
} else {
return "unknown argument $a[1], choose one of ".