Ignore:
Timestamp:
2010-01-18T01:00:17+01:00 (10 years ago)
Author:
bastiK
Message:

use PrimaryDateParser to parse time of GPS points (for geoimage)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java

    r2867 r2874  
    1111import org.openstreetmap.josm.data.coor.LatLon;
    1212import org.openstreetmap.josm.tools.DateUtils;
     13import org.openstreetmap.josm.tools.PrimaryDateParser;
    1314
    1415public class WayPoint extends WithAttributes implements Comparable<WayPoint>
     
    4243     */
    4344    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;
    4951            }
    5052        }
Note: See TracChangeset for help on using the changeset viewer.