Skip to content

Instantly share code, notes, and snippets.

View urbansky's full-sized avatar

Stefan Urbansky urbansky

View GitHub Profile
@urbansky
urbansky / ISO8601.groovy
Created May 30, 2016 12:45
ISO8601 Date
import java.text.DateFormat
import java.text.SimpleDateFormat
TimeZone tz = TimeZone.getTimeZone("Europe/Berlin") // Change the timezone
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmX") // X is the timezone in ISO8601
df.setTimeZone(tz)
String iso8601 = df.format(new Date())