mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
fhem.pl: add $today for use in Perl-Commands (Forum #76444)
git-svn-id: https://svn.fhem.de/fhem/trunk@15037 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2c9e3fe73c
commit
8d5b14b851
@ -1667,7 +1667,8 @@ The following local attributes are used by a wider range of devices:
|
|||||||
$mday, $month, $year, $wday, $yday, $isdst are available in the perl
|
$mday, $month, $year, $wday, $yday, $isdst are available in the perl
|
||||||
oneliners (see also perldoc -f localtime). Exceptions: $month is in the
|
oneliners (see also perldoc -f localtime). Exceptions: $month is in the
|
||||||
range of 1 to 12, and $year is corrected by 1900 (as I would expect).
|
range of 1 to 12, and $year is corrected by 1900 (as I would expect).
|
||||||
Additionally the variable $hms contains the time in the HH:MM:SS format.
|
Additionally the variable $hms contains the time in the HH:MM:SS format and
|
||||||
|
$today the current date in YYYY-MM-DD format.
|
||||||
<br>
|
<br>
|
||||||
Additionally the variabe $we is 1 if it is weekend (i.e $wday == 0 or
|
Additionally the variabe $we is 1 if it is weekend (i.e $wday == 0 or
|
||||||
$wday == 6), and 0 otherwise. If the <a href="#holiday2we">holida2we</a>
|
$wday == 6), and 0 otherwise. If the <a href="#holiday2we">holida2we</a>
|
||||||
|
@ -1796,7 +1796,8 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet:
|
|||||||
für die Verwendung in PERL-"oneliners" eingeführt (s.
|
für die Verwendung in PERL-"oneliners" eingeführt (s.
|
||||||
unter perldoc -f localtime). Ausnahmen: $month hat einen Wertebereich von 1
|
unter perldoc -f localtime). Ausnahmen: $month hat einen Wertebereich von 1
|
||||||
to 12 und $year ist korrigiert von 1900.
|
to 12 und $year ist korrigiert von 1900.
|
||||||
Weiterhin enthät $hms die Zeit in dem HH:MM:SS Format.
|
Weiterhin enthät $hms die Zeit in dem HH:MM:SS Format und $today den
|
||||||
|
aktuellen Datum in YYYY-MM-DD Format.
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
Die Variabe $we hat den Wert 1 wenn der abgefragte Tag auf ein Wochenende
|
Die Variabe $we hat den Wert 1 wenn der abgefragte Tag auf ein Wochenende
|
||||||
|
@ -1061,6 +1061,7 @@ AnalyzePerlCommand($$;$)
|
|||||||
}
|
}
|
||||||
$month++;
|
$month++;
|
||||||
$year+=1900;
|
$year+=1900;
|
||||||
|
my $today = sprintf('%04d-%02d-%02d', $year,$month,$mday);
|
||||||
|
|
||||||
if($evalSpecials) {
|
if($evalSpecials) {
|
||||||
$cmd = join("", map { my $n = substr($_,1); # ignore the %
|
$cmd = join("", map { my $n = substr($_,1); # ignore the %
|
||||||
|
Loading…
Reference in New Issue
Block a user