fork(14) download
  1. def dateFormat = 'yyyy-MM-dd'
  2.  
  3. Date.metaClass.nextDay = {
  4. use(groovy.time.TimeCategory) {
  5. def nDay = delegate + 1.day
  6. nDay.format(dateFormat)
  7. }
  8. }
  9.  
  10. def dateString = '2017-12-14'
  11. def date = Date.parse(dateFormat, dateString)
  12. println date.nextDay()
  13.  
  14. def date2 = new Date()
  15. println date2.nextDay()
Success #stdin #stdout 1.22s 91180KB
stdin
Standard input is empty
stdout
2017-12-15
2017-12-19