Ajouter 1Hour à Java.SQL.Timetamp en GSP ou Groovy
-
21-12-2019 - |
Question
Je convertitons une nouvelle date () à GMT.Maintenant, j'ai besoin d'ajouter une heure au temps GMT.La classe est Java.SQL.TMESTAMP.Comment ajouter 1 heure à la variable Nowgmt dans Grails.J'ai un plug-in Magic Number installé dans mon projet.
merci!
La solution
Avez-vous essayé:
import groovy.time.TimeCategory
...
Timestamp plusOne = use( TimeCategory ) { nowGMT + 1.hour }.toTimestamp()
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow