Datum und Uhrzeit in einem bestimmten Format

Begonnen von Dduieh, 30 November 2014, 01:45:56

Vorheriges Thema - Nächstes Thema

Dduieh

Hallo,

in einem Notify brauche ich im DEF das aktuelle Datum im Format TT.MM.YY als Variable.
Außerdem brauche ich die aktuelle Uhrzeit im Format HH.MM auch als Varialbe.

Danke für Eure Hilfe!

Markus

Sollen wir jetzt die Suche verwendet und dir das Ergebnis Posten?
Raspberry Pi2 als FHEM-Plattform
HM, FS20, 1-Wire, PanStamp,LW12,Intertechno,ESPEasy,Alexa

Dduieh

Ich habe nichts gefunden, wie man das Datum in TT.MM.YY formatiert.

Puschel74

Hallo,

ZitatIch habe nichts gefunden
Vermutlich nur die falschen Suchbegriffe verwendet  ;)

Du kannst mit localtime die Variablen füllen lassen und dann einfach zusammenbauen wie du es haben möchtest.
Das klappt mit Datum und auch mit Uhrzeit.
localtime und Beispiele dazu findest du vermutlich im Wiki und auch hier im Forum.

my ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime;

Grüße
Zotac BI323 als Server mit DBLog
CUNO für FHT80B, 3 HM-Lan per vCCU, RasPi mit CUL433 für Somfy-Rollo (F2F), RasPi mit I2C(LM75) (F2F), RasPi für Panstamp+Vegetronix +SONOS(F2F)
Ich beantworte keine Supportanfragen per PM! Bitte im Forum suchen oder einen Beitrag erstellen.

igami

Zitat von: Dduieh am 30 November 2014, 01:45:56
in einem Notify brauche ich im DEF das aktuelle Datum im Format TT.MM.YY als Variable.
Außerdem brauche ich die aktuelle Uhrzeit im Format HH.MM auch als Varialbe.

Was hast du eigentlich vor?

Grüße
Igami
Pi3 mit fhem.cfg + DbLog/logProxy
Komm vorbei zum FHEM Treffen im Kreis Gütersloh! Das nächste Mal im April 2020.

MAINTAINER: archetype, LuftdatenInfo, monitoring, msgDialog, Nmap, powerMap
ToDo: AVScene, FluxLED