Changeset 15250 in josm


Ignore:
Timestamp:
2019-07-14T17:04:28+02:00 (6 years ago)
Author:
Don-vip
Message:

see #17829 - use UTC timezone instead of local one

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/rtklib/RtkLibPosReader.java

    r15247 r15250  
    2222import org.openstreetmap.josm.io.IGpxReader;
    2323import org.openstreetmap.josm.tools.Logging;
     24import org.openstreetmap.josm.tools.date.DateUtils;
    2425import org.xml.sax.SAXException;
    2526
     
    6162    public RtkLibPosReader(InputStream source) throws IOException {
    6263        this.source = Objects.requireNonNull(source);
     64        dateTimeFmt.setTimeZone(DateUtils.UTC);
    6365    }
    6466
  • trunk/src/org/openstreetmap/josm/tools/date/DateUtils.java

    r15045 r15250  
    3636     * The UTC time zone.
    3737     */
    38     public static final TimeZone UTC = TimeZone.getTimeZone("UTC");
     38    public static final TimeZone UTC = TimeZone.getTimeZone(ZoneOffset.UTC);
    3939
    4040    /**
  • trunk/test/unit/org/openstreetmap/josm/io/rtklib/RtkLibPosReaderTest.java

    r15247 r15250  
    5555
    5656        List<WayPoint> wayPoints = new ArrayList<>(in.getGpxData().tracks.iterator().next().getSegments().iterator().next().getWayPoints());
    57         assertEquals(DateUtils.fromString("2019-06-08T06:23:12.000Z"), wayPoints.get(0).get(GpxConstants.PT_TIME));
    58         assertEquals(DateUtils.fromString("2019-06-08T06:23:12.300Z"), wayPoints.get(1).get(GpxConstants.PT_TIME));
    59         assertEquals(DateUtils.fromString("2019-06-08T06:23:12.600Z"), wayPoints.get(2).get(GpxConstants.PT_TIME));
     57        assertEquals(DateUtils.fromString("2019-06-08T08:23:12.000Z"), wayPoints.get(0).get(GpxConstants.PT_TIME));
     58        assertEquals(DateUtils.fromString("2019-06-08T08:23:12.300Z"), wayPoints.get(1).get(GpxConstants.PT_TIME));
     59        assertEquals(DateUtils.fromString("2019-06-08T08:23:12.600Z"), wayPoints.get(2).get(GpxConstants.PT_TIME));
    6060        assertEquals(wayPoints.get(0).getDate(), wayPoints.get(0).get(GpxConstants.PT_TIME));
    6161
    62         assertEquals("2019-06-08T06:23:12.000Z", iso8601.format(wayPoints.get(0).getDate()));
    63         assertEquals("2019-06-08T06:23:12.300Z", iso8601.format(wayPoints.get(1).getDate()));
    64         assertEquals("2019-06-08T06:23:12.600Z", iso8601.format(wayPoints.get(2).getDate()));
     62        assertEquals("2019-06-08T08:23:12.000Z", iso8601.format(wayPoints.get(0).getDate()));
     63        assertEquals("2019-06-08T08:23:12.300Z", iso8601.format(wayPoints.get(1).getDate()));
     64        assertEquals("2019-06-08T08:23:12.600Z", iso8601.format(wayPoints.get(2).getDate()));
    6565
    6666        assertEquals(new LatLon(46.948881673, -1.484757046), wayPoints.get(0).getCoor());
Note: See TracChangeset for help on using the changeset viewer.