Groovy web console

subscribe to the feed Subscribe
to this
site

Now_isBetween_wartungsstart_wartungsende

Published 5 months ago by Puri
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
int wartungstart= 1810;     
int wartungende = 1910;     
Date now = new Date();     
Calendar c = Calendar.getInstance();     
c.setTime(now);     
int t = c.get(Calendar.HOUR_OF_DAY) * 100 + c.get(Calendar.MINUTE);     
boolean isBetween = wartungende > wartungstart && t >= wartungstart && t <= wartungende|| wartungende < wartungstart && (t >= wartungstart || t <= wartungende);
print now
print ">" 
print wartungstart
print " &&  <"
println wartungende
println (isBetween)
if (isBetween) {
    println "delay(30*60)"
    println "login"
    println "X"
    println "suche"
    println "Erweiterte Suche"
}
println "suche"
println "Loeschen"
println "OK"