Groovy web console

subscribe to the feed Subscribe
to this

Formatted date with Timezone

Published 4 months ago by Mak with tags date time timezone
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def d = new Date()
def tz = TimeZone.getTimeZone('IST')
//def tz = TimeZone.getTimeZone('GMT+1')
String date = d.format('dd/MMM/yyyy hh:mm:ss a', tz)