I have a Date String in ISO format with Time Zone. I have to convert it into Timestamp with +/- Zone into time using Java 8.0 E.g.
2016-10-14T10:12:18.000+02:00 needs to be converted to 2016-10-14T08:12:18.000+00:00 or 2016-10-14T8:12:18.000Z
String utcDate = "2016-10-14T10:12:18.100+02:00";
ZonedDateTime result = ZonedDateTime.parse(utcDate, DateTimeFormatter.ISO_DATE_TIME);
System.out.println("Parsed: " + result);
Output:
Parsed: 2016-10-14T10:12:18.100+02:00
It doesn't add the zone +02:00 to Date.