How to calculate difference between dates


(Nektarios) #1

I’ve tried doing:

use(groovy.time.TimeCategory) {
duration = duration + (date1- date2).toMilliseconds() / 1000
}
but I get
java.lang.SecurityException: Invoking methods on class groovy.time.TimeDuration is not allowed

I also tried (date1-date2-).seconds but get a similar message on accessing properties on groovy.time.TimeDuration not being allowed


(Chuck Pearce) #2

now().time or your date object.time