Last active
November 25, 2015 08:19
-
-
Save qrtt1/20db13d5ccbd80c7bbd6 to your computer and use it in GitHub Desktop.
Gradle 皮 Groovy 心!?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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