How do I subtract minutes from current time

后端 未结 1 1914
猫巷女王i
猫巷女王i 2021-01-21 00:15

I am trying to subtract 10 minutes from the current time, but I cant find the proper syntax in the documentation I have looked up

I have this so far

def          


        
1条回答
  •  感情败类
    2021-01-21 00:36

    10.minutes.ago should give what you are looking for

    use( groovy.time.TimeCategory ) {
        println 10.minutes.ago
    }
    

    0 讨论(0)
提交回复
热议问题