Index: trunk/src/org/openstreetmap/josm/io/GpxWriter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxWriter.java	(revision 18218)
+++ trunk/src/org/openstreetmap/josm/io/GpxWriter.java	(revision 18219)
@@ -61,4 +61,5 @@
     private GpxData data;
     private String indent = "";
+    private Instant metaTime;
     private List<String> validprefixes;
 
@@ -66,4 +67,22 @@
     private static final int ROUTE_POINT = 1;
     private static final int TRACK_POINT = 2;
+
+    /**
+     * Returns the forced metadata time information, if any.
+     * @return the forced metadata time information, or {@code null}
+     * @since 18219
+     */
+    public Instant getMetaTime() {
+        return metaTime;
+    }
+
+    /**
+     * Sets the forced metadata time information.
+     * @param metaTime the forced metadata time information, or {@code null} to use the current time
+     * @since 18219
+     */
+    public void setMetaTime(Instant metaTime) {
+        this.metaTime = metaTime;
+    }
 
     /**
@@ -105,4 +124,5 @@
             });
         }
+        data.put(META_TIME, (metaTime != null ? metaTime : Instant.now()).toString());
         data.endUpdate();
 
@@ -235,5 +255,8 @@
         }
 
-        simpleTag("time", Instant.now().toString());
+        // write the time
+        if (attr.containsKey(META_TIME)) {
+            simpleTag("time", data.getString(META_TIME));
+        }
 
         Bounds bounds = data.recalculateBounds();
