Changeset 2874 in josm for trunk/src/org
- Timestamp:
- 2010-01-18T01:00:17+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java
r2867 r2874 11 11 import org.openstreetmap.josm.data.coor.LatLon; 12 12 import org.openstreetmap.josm.tools.DateUtils; 13 import org.openstreetmap.josm.tools.PrimaryDateParser; 13 14 14 15 public class WayPoint extends WithAttributes implements Comparable<WayPoint> … … 42 43 */ 43 44 public void setTime() { 44 if(attr.containsKey("time")) 45 { 46 double t = DateUtils.fromString(attr.get("time").toString()).getTime(); 47 if(t != 0.0) { 48 time = t / 1000.0; /* ms => seconds */ 45 if(attr.containsKey("time")) { 46 PrimaryDateParser dateParser = new PrimaryDateParser(); 47 try { 48 time = dateParser.parse(attr.get("time").toString()).getTime() / 1000.; /* ms => seconds */ 49 } catch(Exception e) { 50 time = 0; 49 51 } 50 52 }
Note:
See TracChangeset
for help on using the changeset viewer.