Question

I convert new Date() to GMT. Now I need to add 1 hour to GMT time. The class is java.sql.timeStamp. How do I add 1 hour to the nowGMT variable in grails. I have magic number plugin installed in my project.

Thanks!

Was it helpful?

Solution

Have you tried:

import groovy.time.TimeCategory

...

Timestamp plusOne = use( TimeCategory ) { nowGMT + 1.hour }.toTimestamp()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top