umm, I wouldn’t say that, at least in the case of createTimer()
as used in rules.
Although we invariably set them up with e.g. now.plusMinutes(5)
, that is designating a moment in time.
We do it that way because createTimer() wants a datetime target.
So in truth you must do this.
The question is really about calculating that target time, which is really a datetime.
You’d usually start with “now” - which is itself a datetime object - and use the methods available to modify it.
now.plusMinutes(nn)
is familiar
now.withHour(nn)
perhaps less familiar
There are a whole lot of such methods. Other methods like
x = myDateTime.getHour
would be useful for the other part of your question.
Don’t forget when forcing a time using today’s date that the result may already be in the past.
You might find this a source of inspiration