Index: trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java	(revision 14455)
+++ trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java	(revision 14456)
@@ -9,9 +9,9 @@
 import java.util.Collections;
 import java.util.Date;
-import java.util.DoubleSummaryStatistics;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.LongSummaryStatistics;
 import java.util.Map;
 import java.util.NoSuchElementException;
@@ -175,5 +175,5 @@
                 Date prevWpTime = null;
                 for (WayPoint wp : wpsOld) {
-                    Date wpTime = wp.setTimeFromAttribute();
+                    Date wpTime = wp.getDate();
                     boolean overlap = false;
                     if (wpTime != null) {
@@ -267,6 +267,6 @@
 
         GpxTrackSegmentSpan(WayPoint a, WayPoint b) {
-            Date at = a.getTime();
-            Date bt = b.getTime();
+            Date at = a.getDate();
+            Date bt = b.getDate();
             inv = bt.before(at);
             if (inv) {
@@ -324,5 +324,5 @@
             List<WayPoint> wps = new ArrayList<>(seg.getWayPoints());
             for (int i = forward ? 0 : wps.size() - 1; i >= 0 && i < wps.size(); i += forward ? 1 : -1) {
-                if (wps.get(i).setTimeFromAttribute() != null) {
+                if (wps.get(i).hasDate()) {
                     return wps.get(i);
                 }
@@ -691,11 +691,11 @@
      */
     public static Date[] getMinMaxTimeForTrack(GpxTrack trk) {
-        final DoubleSummaryStatistics statistics = trk.getSegments().stream()
+        final LongSummaryStatistics statistics = trk.getSegments().stream()
                 .flatMap(seg -> seg.getWayPoints().stream())
-                .mapToDouble(pnt -> pnt.time)
+                .mapToLong(pnt -> pnt.getTimeInMillis())
                 .summaryStatistics();
         return statistics.getCount() == 0
                 ? null
-                : new Date[]{new Date((long) (statistics.getMin() * 1000)), new Date((long) (statistics.getMax() * 1000))};
+                : new Date[]{new Date(statistics.getMin()), new Date(statistics.getMax())};
     }
 
@@ -708,14 +708,14 @@
     */
     public synchronized Date[] getMinMaxTimeForAllTracks() {
-        double now = System.currentTimeMillis() / 1000.0;
-        final DoubleSummaryStatistics statistics = tracks.stream()
+        long now = System.currentTimeMillis();
+        final LongSummaryStatistics statistics = tracks.stream()
                 .flatMap(trk -> trk.getSegments().stream())
                 .flatMap(seg -> seg.getWayPoints().stream())
-                .mapToDouble(pnt -> pnt.time)
+                .mapToLong(pnt -> pnt.getTimeInMillis())
                 .filter(t -> t > 0 && t <= now)
                 .summaryStatistics();
         return statistics.getCount() == 0
                 ? new Date[0]
-                : new Date[]{new Date((long) (statistics.getMin() * 1000)), new Date((long) (statistics.getMax() * 1000))};
+                : new Date[]{new Date(statistics.getMin()), new Date(statistics.getMax())};
     }
 
@@ -755,5 +755,5 @@
         double pnminsq = tolerance * tolerance;
         EastNorth bestEN = null;
-        double bestTime = 0.0;
+        double bestTime = Double.NaN;
         double px = p.east();
         double py = p.north();
@@ -774,5 +774,7 @@
                             pnminsq = pRsq;
                             bestEN = en;
-                            bestTime = r.time;
+                            if (r.hasDate()) {
+                                bestTime = r.getTime();
+                            }
                         }
                     } else {
@@ -800,5 +802,7 @@
                                 double ny = ry + rnoverRS * a;
                                 bestEN = new EastNorth(nx, ny);
-                                bestTime = r.time + rnoverRS * (wpSeg.time - r.time);
+                                if (r.hasDate() && wpSeg.hasDate()) {
+                                    bestTime = r.getTime() + rnoverRS * (wpSeg.getTime() - r.getTime());
+                                }
                                 pnminsq = pnsq;
                             }
@@ -820,5 +824,7 @@
                         pnminsq = prsq;
                         bestEN = c;
-                        bestTime = r.time;
+                        if (r.hasDate()) {
+                            bestTime = r.getTime();
+                        }
                     }
                 }
@@ -828,5 +834,7 @@
             return null;
         WayPoint best = new WayPoint(ProjectionRegistry.getProjection().eastNorth2latlon(bestEN));
-        best.time = bestTime;
+        if (!Double.isNaN(bestTime)) {
+            best.setTimeInMillis((long) (bestTime * 1000));
+        }
         return best;
     }
Index: trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java	(revision 14455)
+++ trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java	(revision 14456)
@@ -46,5 +46,5 @@
                     int wp;
                     for (wp = 0; wp < wps.size(); wp++) {
-                        if (wps.get(wp).setTimeFromAttribute() != null) {
+                        if (wps.get(wp).hasDate()) {
                             break;
                         }
@@ -62,5 +62,5 @@
                     if (o1.isEmpty() || o2.isEmpty())
                         return 0;
-                    return Double.compare(o1.get(0).time, o2.get(0).time);
+                    return o1.get(0).compareTo(o2.get(0));
                 });
                 trks.add(segs);
@@ -72,5 +72,5 @@
              || o2.isEmpty() || o2.get(0).isEmpty())
                 return 0;
-            return Double.compare(o1.get(0).get(0).time, o2.get(0).get(0).time);
+            return o1.get(0).get(0).compareTo(o2.get(0).get(0));
         });
 
@@ -111,10 +111,9 @@
                 for (int i = 0; i < wps.size(); i++) {
                     WayPoint curWp = wps.get(i);
-                    Date parsedTime = curWp.setTimeFromAttribute();
                     // Interpolate timestamps in the segment, if one or more waypoints miss them
-                    if (parsedTime == null) {
+                    if (!curWp.hasDate()) {
                         //check if any of the following waypoints has a timestamp...
-                        if (i > 0 && wps.get(i - 1).time != 0) {
-                            long prevWpTimeNoOffset = wps.get(i - 1).getTime().getTime();
+                        if (i > 0 && wps.get(i - 1).hasDate()) {
+                            long prevWpTimeNoOffset = wps.get(i - 1).getTimeInMillis();
                             double totalDist = 0;
                             List<Pair<Double, WayPoint>> nextWps = new ArrayList<>();
@@ -122,16 +121,14 @@
                                 totalDist += wps.get(j - 1).getCoor().greatCircleDistance(wps.get(j).getCoor());
                                 nextWps.add(new Pair<>(totalDist, wps.get(j)));
-                                final Date nextTime = wps.get(j).setTimeFromAttribute();
-                                if (nextTime != null) {
+                                if (wps.get(j).hasDate()) {
                                     // ...if yes, interpolate everything in between
-                                    long timeDiff = nextTime.getTime() - prevWpTimeNoOffset;
+                                    long timeDiff = wps.get(j).getTimeInMillis() - prevWpTimeNoOffset;
                                     for (Pair<Double, WayPoint> pair : nextWps) {
-                                        pair.b.setTime(new Date((long) (prevWpTimeNoOffset + (timeDiff * (pair.a / totalDist)))));
+                                        pair.b.setTimeInMillis((long) (prevWpTimeNoOffset + (timeDiff * (pair.a / totalDist))));
                                     }
                                     break;
                                 }
                             }
-                            parsedTime = curWp.setTimeFromAttribute();
-                            if (parsedTime == null) {
+                            if (!curWp.hasDate()) {
                                 break; //It's pointless to continue with this segment, because none of the following waypoints had a timestamp
                             }
@@ -142,5 +139,5 @@
                     }
 
-                    final long curWpTime = parsedTime.getTime() + offset;
+                    final long curWpTime = curWp.getTimeInMillis() + offset;
                     boolean interpolate = true;
                     int tagTime = 0;
Index: trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java	(revision 14455)
+++ trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java	(revision 14456)
@@ -5,4 +5,5 @@
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Objects;
@@ -14,4 +15,5 @@
 import org.openstreetmap.josm.data.projection.Projecting;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.date.DateUtils;
 import org.openstreetmap.josm.tools.template_engine.TemplateEngineDataProvider;
 
@@ -23,16 +25,14 @@
 
     /**
-     * The seconds (not milliseconds!) since 1970-01-01 00:00 UTC
-     */
-    public double time;
-    /**
      * The color to draw the segment before this point in
      * @see #drawLine
      */
     public Color customColoring;
+
     /**
      * <code>true</code> indicates that the line before this point should be drawn
      */
     public boolean drawLine;
+
     /**
      * The direction of the line before this point. Used as cache to speed up drawing. Should not be relied on.
@@ -40,10 +40,30 @@
     public int dir;
 
+    /*
+     * We "inline" lat/lon, rather than using a LatLon internally => reduces memory overhead. Relevant
+     * because a lot of GPX waypoints are created when GPS tracks are downloaded from the OSM server.
+     */
+    private final double lat;
+    private final double lon;
+
+    /*
+     * internal cache of projected coordinates
+     */
+    private double east = Double.NaN;
+    private double north = Double.NaN;
+    private Object eastNorthCacheKey;
+
     /**
      * Constructs a new {@code WayPoint} from an existing one.
+     *
+     * Except for PT_TIME attribute, all attribute objects are shallow copied.
+     * This means modification of attr objects will affect original and new {@code WayPoint}.
+     *
      * @param p existing waypoint
      */
     public WayPoint(WayPoint p) {
+        init_attr();
         attr.putAll(p.attr);
+        attr.put(PT_TIME, p.getDate());
         lat = p.lat;
         lon = p.lon;
@@ -51,5 +71,4 @@
         north = p.north;
         eastNorthCacheKey = p.eastNorthCacheKey;
-        time = p.time;
         customColoring = p.customColoring;
         drawLine = p.drawLine;
@@ -62,21 +81,42 @@
      */
     public WayPoint(LatLon ll) {
+        init_attr();
         lat = ll.lat();
         lon = ll.lon();
     }
 
-    /*
-     * We "inline" lat/lon, rather than usinga LatLon internally => reduces memory overhead. Relevant
-     * because a lot of GPX waypoints are created when GPS tracks are downloaded from the OSM server.
-     */
-    private final double lat;
-    private final double lon;
-
-    /*
-     * internal cache of projected coordinates
-     */
-    private double east = Double.NaN;
-    private double north = Double.NaN;
-    private Object eastNorthCacheKey;
+    /**
+     * Interim to detect legacy code that is not using {@code WayPoint.setTime(x)}
+     * functions, but {@code attr.put(PT_TIME, (String) x)} logic.
+     * To remove mid 2019
+     */
+    private void init_attr() {
+        attr = new HashMap<String, Object>(0) {
+            @Override
+            public Object put(String key, Object value) {
+                Object ret = null;
+                if (key != PT_TIME || (key == PT_TIME && value instanceof Date)) {
+                    ret = super.put(key, value);
+                } else {
+                    if (value instanceof String) {
+                        ret = super.put(PT_TIME, DateUtils.fromString((String) value));
+                        List<String> lastErrorAndWarnings = Logging.getLastErrorAndWarnings();
+                        if (!lastErrorAndWarnings.isEmpty() && !lastErrorAndWarnings.get(0).contains("calling WayPoint.put")) {
+                            StackTraceElement[] e = Thread.currentThread().getStackTrace();
+                            int n = 1;
+                            while (n < e.length && "put".equals(e[n].getMethodName())) {
+                                n++;
+                            }
+                            if (n < e.length) {
+                                Logging.warn("{0}:{1} calling WayPoint.put(PT_TIME, ..) is deprecated. " +
+                                    "Use WayPoint.setTime(..) instead.", e[n].getClassName(), e[n].getMethodName());
+                            }
+                        }
+                    }
+                }
+                return ret;
+            }
+        };
+    }
 
     /**
@@ -126,5 +166,5 @@
 
     /**
-     * Sets the {@link #time} field as well as the {@link #PT_TIME} attribute to the specified time.
+     * Sets the {@link #PT_TIME} attribute to the specified time.
      *
      * @param time the time to set
@@ -132,6 +172,5 @@
      */
     public void setTime(Date time) {
-        this.time = time.getTime() / 1000.;
-        this.attr.put(PT_TIME, time);
+        setTimeInMillis(time.getTime());
     }
 
@@ -139,5 +178,5 @@
      * Convert the time stamp of the waypoint into seconds from the epoch.
      *
-     * @deprecated call {@link #setTimeFromAttribute()} directly if you need this
+     * @deprecated Use {@link #setTime(Date)}, {@link #setTime(long)}, {@link #setTimeInMillis(long)}
      */
     @Deprecated
@@ -147,5 +186,5 @@
 
     /**
-     * Sets the {@link #time} field as well as the {@link #PT_TIME} attribute to the specified time.
+     * Sets the {@link #PT_TIME} attribute to the specified time.
      *
      * @param ts seconds from the epoch
@@ -153,9 +192,9 @@
      */
     public void setTime(long ts) {
-        setTimeInMillis(ts*1000);
-    }
-
-    /**
-     * Sets the {@link #time} field as well as the {@link #PT_TIME} attribute to the specified time.
+        setTimeInMillis(ts * 1000);
+    }
+
+    /**
+     * Sets the {@link #PT_TIME} attribute to the specified time.
      *
      * @param ts milliseconds from the epoch
@@ -163,41 +202,83 @@
      */
     public void setTimeInMillis(long ts) {
-        this.time = ts / 1000.;
-        this.attr.put(PT_TIME, new Date(ts));
-    }
-
-    /**
-     * Convert the time stamp of the waypoint into seconds from the epoch
+        attr.put(PT_TIME, new Date(ts));
+    }
+
+    /**
+     * Convert the time stamp of the waypoint into seconds from the epoch.
      * @return The parsed time if successful, or {@code null}
      * @since 9383
-     */
+     * @deprecated Use {@link #setTime(Date)}, {@link #setTime(long)}, {@link #setTimeInMillis(long)}
+     */
+    @Deprecated
     public Date setTimeFromAttribute() {
-        if (attr.containsKey(PT_TIME)) {
-            final Object obj = get(PT_TIME);
+        Logging.warn("WayPoint.setTimeFromAttribute() is deprecated, please fix calling code");
+        return getDate();
+    }
+
+    @Override
+    public int compareTo(WayPoint w) {
+        return Long.compare(getTimeInMillis(), w.getTimeInMillis());
+    }
+
+    /**
+     * Returns the waypoint time in seconds since the epoch.
+     *
+     * @return the waypoint time
+     */
+    public double getTime() {
+        return getTimeInMillis() / 1000.;
+    }
+
+    /**
+     * Returns the waypoint time in milliseconds since the epoch.
+     *
+     * @return the waypoint time
+     * @since 14456
+     */
+    public long getTimeInMillis() {
+        Date d = getDateImpl();
+        return d == null ? 0 : d.getTime();
+    }
+
+    /**
+     * Returns true if this waypoint has a time.
+     *
+     * @return true if a time is set, false otherwise
+     * @since 14456
+     */
+    public boolean hasDate() {
+        return attr.get(PT_TIME) instanceof Date;
+    }
+
+    /**
+     * Returns the waypoint time Date object.
+     *
+     * @return a copy of the Date object associated with this waypoint
+     * @since 14456
+     */
+    public Date getDate() {
+        return DateUtils.cloneDate(getDateImpl());
+    }
+
+    /**
+     * Returns the waypoint time Date object.
+     *
+     * @return the Date object associated with this waypoint
+     */
+    private Date getDateImpl() {
+        if (attr != null) {
+            final Object obj = attr.get(PT_TIME);
+
             if (obj instanceof Date) {
-                final Date date = (Date) obj;
-                time = date.getTime() / 1000.;
-                return date;
+                return (Date) obj;
             } else if (obj == null) {
                 Logging.info("Waypoint {0} value unset", PT_TIME);
             } else {
                 Logging.warn("Unsupported waypoint {0} value: {1}", PT_TIME, obj);
-                time = 0;
             }
         }
+
         return null;
-    }
-
-    @Override
-    public int compareTo(WayPoint w) {
-        return Double.compare(time, w.time);
-    }
-
-    /**
-     * Returns the waypoint time.
-     * @return the waypoint time
-     */
-    public Date getTime() {
-        return new Date((long) (time * 1000));
     }
 
@@ -228,5 +309,5 @@
         temp = Double.doubleToLongBits(lon);
         result = prime * result + (int) (temp ^ (temp >>> 32));
-        temp = Double.doubleToLongBits(time);
+        temp = getTimeInMillis();
         result = prime * result + (int) (temp ^ (temp >>> 32));
         return result;
@@ -242,5 +323,5 @@
         return Double.doubleToLongBits(lat) == Double.doubleToLongBits(other.lat)
             && Double.doubleToLongBits(lon) == Double.doubleToLongBits(other.lon)
-            && Double.doubleToLongBits(time) == Double.doubleToLongBits(other.time);
+            && getTimeInMillis() == other.getTimeInMillis();
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 14455)
+++ trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 14456)
@@ -801,5 +801,5 @@
                 wpt.setTimeInMillis(time);
             } else if (n.hasKey(GpxConstants.PT_TIME)) {
-                wpt.setTime(DateUtils.fromString(n.get(GpxConstants.PT_TIME)));
+                wpt.setTimeInMillis(DateUtils.tsFromString(n.get(GpxConstants.PT_TIME)));
             } else if (!n.isTimestampEmpty()) {
                 wpt.setTime(Integer.toUnsignedLong(n.getRawTimestamp()));
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 14455)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 14456)
@@ -1230,7 +1230,6 @@
             for (GpxTrackSegment segment : trk.getSegments()) {
                 for (WayPoint curWp : segment.getWayPoints()) {
-                    final Date parsedTime = curWp.setTimeFromAttribute();
-                    if (parsedTime != null) {
-                        firstGPXDate = parsedTime.getTime();
+                    if (curWp.hasDate()) {
+                        firstGPXDate = curWp.getTimeInMillis();
                         break outer;
                     }
Index: trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java	(revision 14455)
+++ trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java	(revision 14456)
@@ -509,7 +509,7 @@
                             continue;
                         }
-                        if (oldWp != null && trkPnt.time > oldWp.time) {
+                        if (oldWp != null && trkPnt.getTimeInMillis() > oldWp.getTimeInMillis()) {
                             double vel = trkPnt.getCoor().greatCircleDistance(oldWp.getCoor())
-                                    / (trkPnt.time - oldWp.time);
+                                    / (trkPnt.getTime() - oldWp.getTime());
                             velocities.add(vel);
                         }
@@ -587,5 +587,5 @@
                     switch (colored) {
                     case VELOCITY:
-                        double dtime = trkPnt.time - oldWp.time;
+                        double dtime = trkPnt.getTime() - oldWp.getTime();
                         if (dtime > 0) {
                             color = velocityScale.getColor(dist / dtime);
@@ -599,5 +599,5 @@
                         break;
                     case TIME:
-                        double t = trkPnt.time;
+                        double t = trkPnt.getTime();
                         // skip bad timestamps and very short tracks
                         if (t > 0 && t <= now && maxval - minval > minTrackDurationForTimeColoring) {
Index: trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java	(revision 14455)
+++ trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java	(revision 14456)
@@ -150,5 +150,5 @@
                 for (GpxTrackSegment seg : track.getSegments()) {
                     for (WayPoint w : seg.getWayPoints()) {
-                        firstTime = w.time;
+                        firstTime = w.getTime();
                         break;
                     }
@@ -175,7 +175,7 @@
         if (hasWaypoints && Config.getPref().getBoolean("marker.audiofromexplicitwaypoints", true)) {
             for (WayPoint w : layer.data.waypoints) {
-                if (w.time > firstTime) {
+                if (w.getTime() > firstTime) {
                     waypoints.add(w);
-                } else if (w.time > 0.0) {
+                } else if (w.getTime() > 0.0) {
                     timedMarkersOmitted = true;
                 }
@@ -192,5 +192,5 @@
                 if (wNear != null) {
                     WayPoint wc = new WayPoint(w.getCoor());
-                    wc.time = wNear.time;
+                    wc.setTimeInMillis(wNear.getTimeInMillis());
                     if (w.attr.containsKey(GpxConstants.GPX_NAME)) {
                         wc.put(GpxConstants.GPX_NAME, w.getString(GpxConstants.GPX_NAME));
@@ -230,5 +230,5 @@
                 for (GpxTrackSegment seg : track.getSegments()) {
                     for (WayPoint w : seg.getWayPoints()) {
-                        if (startTime < w.time) {
+                        if (startTime < w.getTime()) {
                             w2 = w;
                             break;
@@ -246,6 +246,6 @@
             } else {
                 wayPointFromTimeStamp = new WayPoint(w1.getCoor().interpolate(w2.getCoor(),
-                        (startTime - w1.time) / (w2.time - w1.time)));
-                wayPointFromTimeStamp.time = startTime;
+                        (startTime - w1.getTime()) / (w2.getTime() - w1.getTime())));
+                wayPointFromTimeStamp.setTimeInMillis((long) (startTime * 1000));
                 String name = audioFile.getName();
                 int dot = name.lastIndexOf('.');
@@ -268,5 +268,5 @@
                         WayPoint wStart = new WayPoint(w.getCoor());
                         wStart.put(GpxConstants.GPX_NAME, "start");
-                        wStart.time = w.time;
+                        wStart.setTimeInMillis(w.getTimeInMillis());
                         waypoints.add(wStart);
                         gotOne = true;
@@ -284,13 +284,13 @@
 
         // we must have got at least one waypoint now
-        ((ArrayList<WayPoint>) waypoints).sort(Comparator.comparingDouble(o -> o.time));
+        ((ArrayList<WayPoint>) waypoints).sort((wp, other) -> wp.compareTo(other));
 
         firstTime = -1.0; // this time of the first waypoint, not first trackpoint
         for (WayPoint w : waypoints) {
             if (firstTime < 0.0) {
-                firstTime = w.time;
-            }
-            double offset = w.time - firstTime;
-            AudioMarker am = new AudioMarker(w.getCoor(), w, url, ml, w.time, offset);
+                firstTime = w.getTime();
+            }
+            double offset = w.getTime() - firstTime;
+            AudioMarker am = new AudioMarker(w.getCoor(), w, url, ml, w.getTime(), offset);
             // timeFromAudio intended for future use to shift markers of this type on synchronization
             if (w == wayPointFromTimeStamp) {
Index: trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java	(revision 14455)
+++ trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java	(revision 14456)
@@ -256,5 +256,5 @@
     public WayPoint convertToWayPoint() {
         WayPoint wpt = new WayPoint(getCoor());
-        wpt.setTime((long) (time*1000));
+        wpt.setTimeInMillis((long) (time * 1000));
         if (text != null) {
             wpt.addExtension("text", text);
Index: trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java	(revision 14455)
+++ trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java	(revision 14456)
@@ -97,5 +97,5 @@
         for (WayPoint wpt : indata.waypoints) {
             /* calculate time differences in waypoints */
-            double time = wpt.time;
+            double time = wpt.getTime();
             boolean wptHasLink = wpt.attr.containsKey(GpxConstants.META_LINKS);
             if (firstTime < 0 && wptHasLink) {
Index: trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java	(revision 14455)
+++ trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java	(revision 14456)
@@ -167,5 +167,5 @@
                 if (m instanceof AudioMarker) {
                     AudioMarker a = (AudioMarker) m;
-                    if (a.time > cw.time) {
+                    if (a.time > cw.getTime()) {
                         break;
                     }
@@ -188,5 +188,5 @@
             if (cw != null) {
                 setCoor(cw.getCoor());
-                ca.play(cw.time - ca.time);
+                ca.play(cw.getTime() - ca.time);
             }
             endDrag(false);
@@ -245,5 +245,5 @@
                 return;
             }
-            ca = recent.parentLayer.addAudioMarker(cw.time, cw.getCoor());
+            ca = recent.parentLayer.addAudioMarker(cw.getTime(), cw.getCoor());
         }
 
@@ -330,5 +330,5 @@
             for (GpxTrackSegment trackseg : track.getSegments()) {
                 for (WayPoint w: trackseg.getWayPoints()) {
-                    if (audioTime < w.time) {
+                    if (audioTime < w.getTime()) {
                         w2 = w;
                         break;
@@ -350,5 +350,5 @@
                 w1.getEastNorth(ProjectionRegistry.getProjection()) :
                     w1.getEastNorth(ProjectionRegistry.getProjection()).interpolate(w2.getEastNorth(ProjectionRegistry.getProjection()),
-                            (audioTime - w1.time)/(w2.time - w1.time)));
+                            (audioTime - w1.getTime())/(w2.getTime() - w1.getTime())));
         time = audioTime;
         MapView mapView = MainApplication.getMap().mapView;
Index: trunk/src/org/openstreetmap/josm/io/GpxReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 14455)
+++ trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 14456)
@@ -445,7 +445,7 @@
                     }
                     break;
-                case GpxConstants.PT_TIME:
+                case PT_TIME:
                     try {
-                        currentWayPoint.setTime(DateUtils.fromString(accumulator.toString()));
+                        currentWayPoint.setTimeInMillis(DateUtils.tsFromString(accumulator.toString()));
                     } catch (UncheckedParseException e) {
                         Logging.error(e);
Index: trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java	(revision 14455)
+++ trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java	(revision 14456)
@@ -525,5 +525,5 @@
             if (ps.pWp != currentwp) {
                 if (ps.pWp != null) {
-                    ps.pWp.setTimeFromAttribute();
+                    ps.pWp.getDate();
                 }
                 ps.pWp = currentwp;
