Punith_8
9 years agoOccasional Contributor
Calculating days to a date
Hi, I have a scenario where I need to add days which is stored in a variable to a date(YYYY-MM-DD) which again is stored in a variable. The way I try to add, it is concatenating with the date and...
- 9 years ago
Does the below helps?
import groovy.time.TimeCategory def pattern = 'yyyy-MM-dd' def dateString = '2015-09-29 17:31:54.5454000 -04:00' def b = new Date().parse(pattern,dateString) def c = 16 use (TimeCategory){ def a= b+ c.days println a.format(pattern) }