Need help with tomorrows date

rules
datetime
Tags: #<Tag:0x00007fe0570c2490> #<Tag:0x00007fe0570c2300>

(tellblom) #1

I have the rule below to set current date and I’m trying to get tomorrows date aswell (i.e today +1)
How can I do that?

Using OH2

The items involved:
DateTime todaysDate
DateTime tomorrowsDate

And the rule:

rule "Update Date"
when
Time cron “0 15 * * * ?” or
System started
then

logInfo("OutsideRules", "Updated Current Date")
todaysDate.postUpdate(new DateTimeType())		
tomorrowsDate.postUpdate( **What shall I Write here** )

end


(Rich Koshak) #2
tomorrowsDate.postUpdate(now.plusDays(1).toString)

(tellblom) #3

Thank you, worked like a charm