Ticket #1896: gpxtime.patch
| File gpxtime.patch, 991 bytes (added by , 17 years ago) |
|---|
-
src/org/openstreetmap/josm/data/gpx/WayPoint.java
36 36 */ 37 37 public final static SimpleDateFormat GPXTIMEFMT = 38 38 new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); // ignore timezone 39 public final static SimpleDateFormat GPXTIMEFMT2 = 40 new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); // ignore timezone 39 41 40 42 public void setTime() { 41 43 if (! attr.containsKey("time")) { 42 44 return; 43 45 } 44 46 Date d = GPXTIMEFMT.parse(attr.get("time").toString(), new ParsePosition(0)); 47 if (d == null) { 48 d = GPXTIMEFMT2.parse(attr.get("time").toString(), new ParsePosition(0)); 49 } 45 50 if (d != null /* parsing ok */) { 46 51 time = d.getTime() / 1000.0; /* ms => seconds */ 47 52 }
