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/tools/date/DateUtils.java

    r11048 r11288  
    1313import java.util.Locale;
    1414import java.util.TimeZone;
     15import java.util.concurrent.TimeUnit;
    1516
    1617import javax.xml.datatype.DatatypeConfigurationException;
     
    145146     */
    146147    public static synchronized String fromTimestamp(int timestamp) {
    147         final ZonedDateTime temporal = Instant.ofEpochMilli(timestamp * 1000L).atZone(ZoneOffset.UTC);
     148        final ZonedDateTime temporal = Instant.ofEpochMilli(TimeUnit.SECONDS.toMillis(timestamp)).atZone(ZoneOffset.UTC);
    148149        return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(temporal);
    149150    }
Note: See TracChangeset for help on using the changeset viewer.