Ignore:
Timestamp:
2018-07-28T01:03:54+02:00 (17 months ago)
Author:
Don-vip
Message:

fix #14103 - GPX → OSM: convert additional tags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/date/DateUtils.java

    r12620 r14055  
    148148     * @param timestamp number of seconds since the epoch
    149149     * @return The formatted date
    150      */
    151     public static synchronized String fromTimestamp(int timestamp) {
     150     * @since 14055
     151     */
     152    public static synchronized String fromTimestamp(long timestamp) {
    152153        final ZonedDateTime temporal = Instant.ofEpochMilli(TimeUnit.SECONDS.toMillis(timestamp)).atZone(ZoneOffset.UTC);
    153154        return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(temporal);
     155    }
     156
     157    /**
     158     * Formats a date to the XML UTC format regardless of current locale.
     159     * @param timestamp number of seconds since the epoch
     160     * @return The formatted date
     161     */
     162    public static synchronized String fromTimestamp(int timestamp) {
     163        return fromTimestamp((long) timestamp);
    154164    }
    155165
     
    248258
    249259    /**
     260     * Returns the date format used for GPX waypoints.
     261     * @return the date format used for GPX waypoints
     262     * @since 14055
     263     */
     264    public static DateFormat getGpxFormat() {
     265        return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
     266    }
     267
     268    /**
    250269     * Formats a date to be displayed to current user, based on user preferences.
    251270     * @param date The date to display. Must not be {@code null}
Note: See TracChangeset for help on using the changeset viewer.