Ignore:
Timestamp:
2016-11-20T17:33:33+01:00 (3 years ago)
Author:
simon04
Message:

see #13376 - Use TimeUnit instead of combinations of 1000/60/60/24

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java

    r10600 r11288  
    1414import java.util.Objects;
    1515import java.util.Set;
     16import java.util.concurrent.TimeUnit;
    1617import java.util.concurrent.atomic.AtomicLong;
    1718
     
    249250    @Override
    250251    public void setTimestamp(Date timestamp) {
    251         this.timestamp = (int) (timestamp.getTime() / 1000);
     252        this.timestamp = (int) TimeUnit.MILLISECONDS.toSeconds(timestamp.getTime());
    252253    }
    253254
     
    259260    @Override
    260261    public Date getTimestamp() {
    261         return new Date(timestamp * 1000L);
     262        return new Date(TimeUnit.SECONDS.toMillis(timestamp));
    262263    }
    263264
Note: See TracChangeset for help on using the changeset viewer.