Skip to content

Instantly share code, notes, and snippets.

@easternnl
Created July 9, 2020 14:27
Show Gist options
  • Save easternnl/c7a1062ed83186d8d0851b787b8a80eb to your computer and use it in GitHub Desktop.
Save easternnl/c7a1062ed83186d8d0851b787b8a80eb to your computer and use it in GitHub Desktop.
Convert datetimestamp to epoch in Groovy
import java.time.*
db2time = '2020-07-09 14:19:10.966'
epoch = Date.parse("yyyy-MM-dd HH:mm:ss.SSS", db2time)
log.info("" + epoch.getTime())
return epoch.getTime()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment