RaspberryMatic
RaspberryMatic copied to clipboard
ReGaHSS: .ToString() .Format() -> fehlerhafte Ausgabe bei Zeitwerten mit Weltzeit
Describe the issue you are experiencing
Die Methoden .Format() und .ToString() berücksichtigen nicht den im Variabletyp time mit der Methode .IsLocalTime() hinterlegten Wert für die Angabe, ob es sich um Weltzeit oder lokale Zeit handelt, sondern formatieren die Ausgabe immer, als wäre die lokale Zeit gültig. Dies macht die Methoden .ToString() und .Format() zum Anzeigen von Weltzeiten unbrauchbar.
Describe the behavior you expected
Erwartet würde die korrekte Formatierung unter Berücksichtigung der hinterlegten Eigenschaften im Zeitwert.
Steps to reproduce the issue
Ausführung des folgenden Skriptes unter "Skript testen":
WriteLine("Start");
WriteLine(dom.BuildLabel());
WriteLine(localtime);
WriteLine(currenttime);
WriteLine(localtime.IsLocalTime());
WriteLine(currenttime.IsLocalTime());
WriteLine(localtime.Hour());
WriteLine(currenttime.Hour());
WriteLine("");
WriteLine("----------- .Format() -----------------------------");
WriteLine("");
WriteLine(localtime.Format("%c"));
WriteLine(currenttime.Format("%c"));
WriteLine(localtime.Format("%T"));
WriteLine(currenttime.Format("%T"));
WriteLine(localtime.Format("%Z"));
WriteLine(currenttime.Format("%Z"));
WriteLine(localtime.Format("%z"));
WriteLine(currenttime.Format("%z"));
WriteLine("");
WriteLine("----------- .ToString() -----------------------------");
WriteLine("");
WriteLine(localtime);
WriteLine(currenttime);
WriteLine(localtime.IsLocalTime());
WriteLine(currenttime.IsLocalTime());
WriteLine(localtime.ToString("%c"));
WriteLine(currenttime.ToString("%c"));
WriteLine(localtime.ToString("%T"));
WriteLine(currenttime.ToString("%T"));
WriteLine(localtime.ToString("%Z"));
WriteLine(currenttime.ToString("%Z"));
WriteLine(localtime.ToString("%z"));
WriteLine(currenttime.ToString("%z"));
WriteLine("Ende");
What is the version this bug report is based on?
CCU3 mit ReGaHSS-Version R1.00.0388.0235
Which base platform are you running?
rpi3 (RaspberryPi3)
Which HomeMatic/homematicIP radio module are you using?
n/a
Anything in the logs that might be useful for us?
bestehend seit:
unbekannt (bereits mit ReGaHss-Version R1.00.0388.0102)
Additional information
Ausgabe des Skriptes (uhrzeitabhängig) :
Start
R1.00.0388.0235
2024-03-08 21:01:41
2024-03-08 21:01:41
1
0
21
20
----------- .Format() -----------------------------
Fri Mar 8 21:01:41 2024
Fri Mar 8 21:01:41 2024
21:01:41
21:01:41
CET
CET
+0100
+0100
----------- .ToString() -----------------------------
2024-03-08 21:01:42
2024-03-08 21:01:42
1
0
Fri Mar 8 21:01:42 2024
Fri Mar 8 21:01:42 2024
21:01:42
21:01:42
CET
CET
+0100
+0100
Ende