I am struggling with a bit of code in a OH2.1 rule to show me what the time is in “now + XX minutes” ; I have a formula calculating the minutes into the future I need - but I cannot figure out how to use the .plusMinutes to get it working.
Basically, I want to show what the time is when I add the number of minutes I have calculated - to the current time of day.
Here is my draft (which keeps failing):
var Number min_to_comfort = 142.45 // This is just a test - normally there will be a formula behind this var SimpleDateFormat df = new SimpleDateFormat( "HH:mm" ) var String Timestamp = df.format( new Date() ) var String Time2 = df.plusMinutes(min_to_comfort).format( new Date() ) logInfo("POOL", "Pool heating has been initated at " + Timestamp + ". Comfort temp estimated reached at " + Time2)
Anyone who have done this - or can see what I am doing wrong ?