CurrentHour = OK - and minutes?

hello

this script is ok

rule "Pumpe"
	when 
		Time cron "0 0/15 * * * ?"	
	then
		var CurrentHour = now.getHourOfDay
		if ((CurrentHour >=12 && CurrentHour <=13)) Sonoff_Pool1.sendCommand(ON)
		else Sonoff_Pool1.sendCommand(OFF)
		
end

Pool goes on between 12:00 and 13:00
But how can i change this e.g. to 12:15 - 12:45 ?

regard

if(now.isAfter(now.withTimeAtStartOfDay.plusHours(12).plusMinutes(15)) &&
   now.isBefore(now.withTimeAtStartOfDay.plusHours(12).plusMinutes(45)) {
2 Likes