Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxData.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxData.java	(revision 28688)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxData.java	(revision 28689)
@@ -3,4 +3,5 @@
 import java.util.ArrayList;
 import java.util.List;
+import java.util.NoSuchElementException;
 
 import org.openstreetmap.josm.data.gpx.GpxData;
@@ -44,7 +45,16 @@
         GpxData result = new GpxData();
 
+        double minTime = 0.0;
+        if (anonTime) {
+            try {
+                minTime = minNonDeletedTime();
+            } catch (NoSuchElementException e) {
+                // minTime won't be used, so ignore the exception
+            }
+        }
+
         for (EditGpxTrack track: tracks) {
             if (!track.isDeleted()) {
-                GpxTrack newTrack = track.createGpxTrack(anonTime);
+                GpxTrack newTrack = track.createGpxTrack(anonTime, minTime);
                 if (!newTrack.getSegments().isEmpty()) {
                     result.tracks.add(newTrack);
@@ -58,3 +68,31 @@
     }
 
+    /**
+     * time of the oldest waypoint in the set of non-deleted waypoints
+     * in this data (in seconds since Epoch)
+     */
+    public double minNonDeletedTime() {
+        boolean foundOne = false;
+        double minTime = 0.0;
+
+        for (EditGpxTrack track: tracks) {
+            if (!track.isDeleted()) {
+                try {
+                    double t = track.minNonDeletedTime();
+                    if ((!foundOne) || (t < minTime)) {
+                        minTime = t;
+                    }
+                    foundOne = true;
+                } catch (NoSuchElementException e) {
+                    continue;
+                }
+            }
+        }
+
+        if (!foundOne) {
+            throw new NoSuchElementException();
+        }
+        return minTime;
+    }
+
 }
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxTrack.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxTrack.java	(revision 28688)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxTrack.java	(revision 28689)
@@ -1,9 +1,14 @@
 package org.openstreetmap.josm.plugins.editgpx.data;
 
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.TimeZone;
 
 import org.openstreetmap.josm.data.gpx.GpxTrack;
@@ -32,7 +37,12 @@
     }
 
-    public GpxTrack createGpxTrack(boolean anonTime) {
+    public GpxTrack createGpxTrack(boolean anonTime, double minTime) {
 
         Collection<Collection<WayPoint>> wayPoints = new ArrayList<Collection<WayPoint>>();
+
+        final DateFormat iso8601 =
+            new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+        final TimeZone utc = TimeZone.getTimeZone("UTC");
+        iso8601.setTimeZone(utc);
 
         for (EditGpxTrackSegment segment: segments) {
@@ -43,6 +53,9 @@
                         // convert to anonymous time
                         for (WayPoint w : points) {
-                            w.attr.put("time", "1970-01-01T00:00:00.000Z");
+                            double t = w.time - minTime;
+                            w.attr.put("time", iso8601.format(
+                                    new Date((long)(t * 1000))));
                             w.setTime();
+                            assert w.time == t;
                             if (w.attr.containsKey("name")) {
                                 w.attr.put("name", "anon"); //time information can also be in "name" field. so delete time information
@@ -70,3 +83,31 @@
         return isDeleted;
     }
+
+    /**
+     * time of the oldest waypoint in the set of non-deleted waypoints
+     * in this track (in seconds since Epoch)
+     */
+    public double minNonDeletedTime() {
+        boolean foundOne = false;
+        double minTime = 0.0;
+
+        for (EditGpxTrackSegment segment: segments) {
+            if (!segment.isDeleted()) {
+                try {
+                    double t = segment.minNonDeletedTime();
+                    if ((!foundOne) || (t < minTime)) {
+                        minTime = t;
+                    }
+                    foundOne = true;
+                } catch (NoSuchElementException e) {
+                    continue;
+                }
+            }
+        }
+
+        if (!foundOne) {
+            throw new NoSuchElementException();
+        }
+        return minTime;
+    }
 }
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxTrackSegment.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxTrackSegment.java	(revision 28688)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxTrackSegment.java	(revision 28689)
@@ -2,4 +2,5 @@
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
@@ -42,3 +43,11 @@
     }
 
+    /**
+     * time of the oldest waypoint in the set of non-deleted waypoints
+     * in this segment (in seconds since Epoch)
+     */
+    public double minNonDeletedTime() {
+        return Collections.min(getNonDeletedWaypoints()).time;
+    }
+
 }
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxWayPoint.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxWayPoint.java	(revision 28688)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxWayPoint.java	(revision 28689)
@@ -7,5 +7,5 @@
 import org.openstreetmap.josm.data.gpx.WayPoint;
 
-public class EditGpxWayPoint {
+public class EditGpxWayPoint implements Comparable<EditGpxWayPoint> {
     private final double time;
     private final CachedLatLon coor;
@@ -34,6 +34,17 @@
     }
 
+    /**
+     * returns this waypoint's time in seconds since Epoch
+     */
+    public double getTime() {
+        return time;
+    }
+
     public CachedLatLon getCoor() {
         return coor;
     }
+
+    public int compareTo(EditGpxWayPoint o) {
+        return Double.compare(getTime(), o.getTime());
+    }
 }
