Created
July 30, 2015 01:22
-
-
Save 0x1b-xyz/3bc993fb9602a2294ae3 to your computer and use it in GitHub Desktop.
Date examples I bust out when I'm showing off 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
def tomorrow = new Date() + 1 | |
use (TimeCategory) { | |
def appointment = now + 1.week + 1.days + 15.hours + 10.minutes | |
def monday = new Date().with { it.clearTime(); it - it.calendarDate.dayOfWeek } | |
def recurringWeeklyForYear = (1..52).collect { monday + it.weeks } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment