VaniV28
4 years agoOccasional Contributor
Error when using groovy script to tomorrow's date
Hi I'm using the following script to get tomorrow's date use(groovy.time.TimeCategory) { def tomorrow = new Date() + 1.day //log.info tomorrow.format('yyyy-MM-dd\'T\'HH:mm:ssZ') return tomorr...
- 4 years ago
You can use below code to get the desired result.
import groovy.time.TimeCategory import java.text.SimpleDateFormat use(TimeCategory) { date = (new Date())+1.day sdf = new SimpleDateFormat("yyyy-MM-dd\'T\'HH:mm:ssZ") newDate = sdf.format(date) log.info newDate }