This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
NewerOlder