Skip to content

Instantly share code, notes, and snippets.

@qrtt1
Last active November 25, 2015 08:19
Show Gist options
  • Save qrtt1/20db13d5ccbd80c7bbd6 to your computer and use it in GitHub Desktop.
Save qrtt1/20db13d5ccbd80c7bbd6 to your computer and use it in GitHub Desktop.
Gradle 皮 Groovy 心!?
// reference 1: http://docs.groovy-lang.org/latest/html/api/groovy/time/TimeCategory.html
// reference 2: http://groovycookbook.org/basic_types/dates_times/
import groovy.time.TimeCategory
use ( TimeCategory ) {
// application on numbers:
println 1.minute.from.now
println 10.hours.ago
// application on dates
def someDate = new Date()
println someDate - 3.months
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment