Created
November 5, 2011 00:39
-
-
Save ksky/1340880 to your computer and use it in GitHub Desktop.
TimeCategoryサンプル
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
// TimeCategory | |
import groovy.time.TimeCategory | |
// 日時計算のための便利なカテゴリ | |
use (TimeCategory) { | |
println 10.hours.ago | |
println 3.days.from.today | |
println 1.year.from.now | |
println((1.minute + 30.seconds).from.now) | |
def now = new Date() | |
println now - 3.months | |
println now + 1.week | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment