Transform a groovy code to painless

I wanna translate this groovy code to a painless one :

use (groovy.time.TimeCategory) {
println new Date()
println 20.days.from.now
}

I tried this :

def date = new Date()
date = date-20.days.from.now
return date

but it didn't work

Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.