Need some guide on how to schedule a handler that running everyday 00:00 based on the hub location timezone?
example code
def someEventHandler(evt) {
def now = new Date().format("dd MMM yyyy hh:mm:ss a", location.timeZone) // This function use to get date time in current location timezone
def startDay = "00:00" // I want to start to run the handler everyday at 00:00 with current location timezone
schedule(startDay, handlerMethod)
}
def handlerMethod() {
...
}
I’m pretty sure that it already takes into account the Time Zone of the hub, so you can use any of the methods that rely on time. What about just using the cronExpression version and setting it to run that way.
def someEventHandler(evt) {
def now = new Date().format("dd MMM yyyy hh:mm:ss a", location.timeZone) // This function use to get date time in current location timezone
def startDay = "00:00" // I want to start to run the handler everyday at 00:00 with current location timezone
schedule(startDay, handlerMethod)
}
def handlerMethod() {
...
}