Changeset 553 in josm for trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java
- Timestamp:
- 2008-02-21T19:53:16+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java
r552 r553 16 16 public final LatLon latlon; 17 17 public final EastNorth eastNorth; 18 public double time; 18 19 19 20 public WayPoint(LatLon ll) { 20 21 latlon = ll; 21 eastNorth = Main.proj.latlon2eastNorth(ll); 22 eastNorth = Main.proj.latlon2eastNorth(ll); 22 23 } 23 24 … … 31 32 * @return seconds 32 33 */ 33 public double time () {34 public void setTime () { 34 35 if (! attr.containsKey("time")) 35 return0.0;36 time = 0.0; 36 37 SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); // ignore timezone 37 38 Date d = f.parse(attr.get("time").toString(), new ParsePosition(0)); 38 39 if (d == null /* failed to parse */) 39 return0.0;40 returnd.getTime() / 1000.0; /* ms => seconds */40 time = 0.0; 41 time = d.getTime() / 1000.0; /* ms => seconds */ 41 42 } 42 43
Note:
See TracChangeset
for help on using the changeset viewer.