hi scott.
first of all: sorry i´m not a programmer and i hope i don´t write nonsense here. i will try to explain what i did, probably i did something wrong:
until now i had a rule and i needed to check when was the last update of an item. this i did with a global variable
var sAbzug_LastUpdate = DateTime.now()
and in the rule:
if(sAbzug_LastUpdate.isAfter(now.minusSeconds(3).millis)){
logError("test", "time now is " + now.toString)
logError("test", "time last update was " + sAbzug_LastUpdate.toString)
tWarten.reschedule(now.plusMillis(3500))
}else{
sAbzug_LastUpdate = DateTime.now()
}
this produces following log:
2020-02-19 07:29:11.302 [ERROR] [.eclipse.smarthome.model.script.test] - time now is 2020-02-19T07:29:11.300+01:00
2020-02-19 07:29:11.309 [ERROR] [.eclipse.smarthome.model.script.test] - time last update was 2020-02-19T07:29:09.589+01:00
… you see the time-zone at the end is here:
+01:00
now i want to switch this to jython and tried to assign the update-time to an item: