Changeset 14434 in josm for trunk/src/org/openstreetmap/josm/data/gpx
- Timestamp:
- 2018-11-20T01:13:10+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java
r14159 r14434 129 129 130 130 /** 131 * Sets the {@link #time} field as well as the {@link #PT_TIME} attribute to the specified time 131 * Sets the {@link #time} field as well as the {@link #PT_TIME} attribute to the specified time. 132 132 * 133 133 * @param time the time to set … … 140 140 141 141 /** 142 * Convert the time stamp of the waypoint into seconds from the epoch 143 */ 142 * Convert the time stamp of the waypoint into seconds from the epoch. 143 * 144 * @deprecated call {@link #setTimeFromAttribute()} directly if you need this 145 */ 146 @Deprecated 144 147 public void setTime() { 145 148 setTimeFromAttribute(); … … 147 150 148 151 /** 149 * Set the the time stamp of the waypoint into seconds from the epoch, 150 * @param time millisecond from the epoch 152 * Sets the {@link #time} field as well as the {@link #PT_TIME} attribute to the specified time. 153 * 154 * @param ts seconds from the epoch 151 155 * @since 13210 152 156 */ 153 public void setTime(long time) { 154 this.time = time / 1000.; 157 public void setTime(long ts) { 158 this.time = ts; 159 this.attr.put(PT_TIME, DateUtils.fromTimestamp(ts)); 160 } 161 162 /** 163 * Sets the {@link #time} field as well as the {@link #PT_TIME} attribute to the specified time. 164 * 165 * @param ts milliseconds from the epoch 166 * @since 14434 167 */ 168 public void setTimeInMillis(long ts) { 169 this.time = ts / 1000.; 170 this.attr.put(PT_TIME, DateUtils.fromTimestampInMillis(ts)); 155 171 } 156 172
Note:
See TracChangeset
for help on using the changeset viewer.
