Hello!
Perhaps the following will help you.
The script (for a subsequent condition) is not particularly elegant, but it works.
The basis is the variable "
getDate()" which provides the date and time in milliseconds.
(A change to "
triggertime" would also be possible, since both variables are based on the date and time in milliseconds from 1970-01-01 00:00:00.)
"
getDate() - getDate("{getDate(),dateformat,yyyy-MM-dd}","yyyy-MM-dd")" removes the date from "
getDate()" and returns the time in milliseconds.
The rest of the script converts the result into a "understandable" decimal number
[hours],[minutes] (Variable "
time").
The decimal places are "real minutes" (60 units, not 100 units). (10:30 = 10,30 not 10:30 = 10,50)
Variant 1 (Script):
hour = (getDate() - getDate("{getDate(),dateformat,yyyy-MM-dd}","yyyy-MM-dd")) / 3600000;
minute = floor((((getDate() - getDate("{getDate(),dateformat,yyyy-MM-dd}","yyyy-MM-dd")) / 36000.) - (hour * 100)) / 100. * 60.);
time = hour + (minute / 100.)
Variant 2, compact (Script):
time = ((getDate() - getDate("{getDate(),dateformat,yyyy-MM-dd}","yyyy-MM-dd")) / 3600000) + (floor((((getDate() - getDate("{getDate(),dateformat,yyyy-MM-dd}","yyyy-MM-dd")) / 36000.) - (((getDate() - getDate("{getDate(),dateformat,yyyy-MM-dd}","yyyy-MM-dd")) / 3600000) * 100)) / 100. * 60.) / 100.)
(
The point behind some numbers forces the calculation with decimal places!)
I wish you success!
greeting
Peter
-----------------------------------------------------------------------------------------------------------------------------------------
(
I can master this strange language better, so once again in the original!)
Hallo!
Vielleicht hilft dir Folgendes weiter.
Das Script (für eine nachfolgende Condition) ist nicht besonders elegant, aber es funktioniert.
Grundlage ist die Variable "
getDate()", welche das Datum und die Uhrzeit in Millisekunden liefert.
(Eine Umstellung auf "
triggertime" wäre aber auch möglich, da beiden Variablen das Datum und die Zeit in Millisekunden ab 1970-01-01 00:00:00 zugrunde liegt.)
"
getDate() - getDate("{getDate(),dateformat,yyyy-MM-dd}","yyyy-MM-dd")" entfernt das Datum aus "
getDate()" und liefert die Zeit in Millisekunden.
Der übrige Teil des Scripts wandelt das Ergebnis in eine "verständliche" Dezimalzahl
[Stunden],[Minuten] um (Variable "
time").
Die Nachkommastellen sind "echte Minuten" (60er-Einheiten, nicht 100er-Einheiten). (10:30 = 10,30 nicht 10:30 = 10,50)
Variante 1 (Script):
hour = (getDate() - getDate("{getDate(),dateformat,yyyy-MM-dd}","yyyy-MM-dd")) / 3600000;
minute = floor((((getDate() - getDate("{getDate(),dateformat,yyyy-MM-dd}","yyyy-MM-dd")) / 36000.) - (hour * 100)) / 100. * 60.);
time = hour + (minute / 100.)
Variante 2, kompakt (Script):
time = ((getDate() - getDate("{getDate(),dateformat,yyyy-MM-dd}","yyyy-MM-dd")) / 3600000) + (floor((((getDate() - getDate("{getDate(),dateformat,yyyy-MM-dd}","yyyy-MM-dd")) / 36000.) - (((getDate() - getDate("{getDate(),dateformat,yyyy-MM-dd}","yyyy-MM-dd")) / 3600000) * 100)) / 100. * 60.) / 100.)
(
Der Punkt hinter einigen Zahlen erzwingt die Berechnung mit Nachkommastellen!)
Viel Erfolg!
Gruß
Peter