diff --git a/src/org/openstreetmap/josm/tools/date/DateUtils.java b/src/org/openstreetmap/josm/tools/date/DateUtils.java
index c8a3245..7f6c19e 100644
--- a/src/org/openstreetmap/josm/tools/date/DateUtils.java
+++ b/src/org/openstreetmap/josm/tools/date/DateUtils.java
@@ -4,6 +4,10 @@
 import java.text.DateFormat;
 import java.text.ParsePosition;
 import java.text.SimpleDateFormat;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
+import java.time.temporal.ChronoField;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
@@ -96,28 +100,23 @@ public static synchronized long tsFromString(String str) {
                 checkLayout(str, "xxxx-xx-xxTxx:xx:xx-xx") ||
                 checkLayout(str, "xxxx-xx-xxTxx:xx:xx+xx:00") ||
                 checkLayout(str, "xxxx-xx-xxTxx:xx:xx-xx:00")) {
-            final Calendar c; // consider EXIF date in default timezone
-            if (checkLayout(str, "xxxx:xx:xx xx:xx:xx")) {
-                c = getLocalCalendar();
-            } else {
-                c = calendar;
-            }
-            c.set(
-                parsePart4(str, 0),
-                parsePart2(str, 5)-1,
-                parsePart2(str, 8),
-                parsePart2(str, 11),
-                parsePart2(str, 14),
-                parsePart2(str, 17));
-            c.set(Calendar.MILLISECOND, 0);
-
+            final ZonedDateTime local = ZonedDateTime.of(
+                    parsePart4(str, 0),
+                    parsePart2(str, 5),
+                    parsePart2(str, 8),
+                    parsePart2(str, 11),
+                    parsePart2(str, 14),
+                    parsePart2(str, 17),
+                    0,
+                    checkLayout(str, "xxxx:xx:xx xx:xx:xx") ? ZoneId.systemDefault() : ZoneOffset.UTC
+            );
             if (str.length() == 22 || str.length() == 25) {
                 int plusHr = parsePart2(str, 20);
                 int mul = str.charAt(19) == '+' ? -3600000 : 3600000;
-                return c.getTimeInMillis()+plusHr*mul;
+                return local.with(ChronoField.MILLI_OF_SECOND, plusHr*mul).toInstant().toEpochMilli();
             }
 
-            return c.getTimeInMillis();
+            return local.toInstant().toEpochMilli();
         } else if (checkLayout(str, "xxxx-xx-xxTxx:xx:xx.xxxZ") ||
                 checkLayout(str, "xxxx-xx-xxTxx:xx:xx.xxx") ||
                 checkLayout(str, "xxxx:xx:xx xx:xx:xx.xxx") ||
