Index: /applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTagger.java
===================================================================
--- /applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTagger.java	(revision 36465)
+++ /applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTagger.java	(revision 36466)
@@ -42,13 +42,15 @@
      * @param dst The output file.
      * @param imageEntry the image object from Josm core
+     * @param writeGpsTime write the EXIF tags GPSDateStamp and GPSTimeStamp
      * @param lossy whether to use lossy approach when writing metadata (overwriting unknown tags)
      * @throws IOException in case of I/O error
      * @since 36436 separate image parameters (lat, lon, gpsTime, speed, ele, imgDir), replaced by the whole ImageEntry object.
+     * @since xxx added writeGpsTime parameter
      */
 
     public static void setExifGPSTag(File imageFile, File dst, ImageEntry imageEntry,
-            boolean lossy) throws IOException {
+            boolean writeGpsTime, boolean lossy) throws IOException {
         try {
-            setExifGPSTagWorker(imageFile, dst, imageEntry, lossy);
+            setExifGPSTagWorker(imageFile, dst, imageEntry, writeGpsTime, lossy);
         } catch (ImagingException ire) {
             // This used to be two separate exceptions; ImageReadException and imageWriteException
@@ -58,5 +60,5 @@
 
     public static void setExifGPSTagWorker(File imageFile, File dst, ImageEntry imageEntry,
-            boolean lossy) throws IOException {
+            boolean writeGpsTime, boolean lossy) throws IOException {
 
         TiffOutputSet outputSet = null;
@@ -80,5 +82,5 @@
         gpsDirectory.add(GpsTagConstants.GPS_TAG_GPS_VERSION_ID, (byte) 2, (byte) 3, (byte) 0, (byte) 0);
 
-        if (imageEntry.getGpsInstant() != null) {
+        if (writeGpsTime && imageEntry.getGpsInstant() != null) {
             Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
             calendar.setTimeInMillis(imageEntry.getGpsInstant().toEpochMilli());
@@ -202,5 +204,5 @@
     /**
      * Normalizes an angle to the range [0.0, 360.0[ degrees.
-     * This will fix any angle value <0 and >= 360 
+     * This will fix any angle value &lt; 0 and &gt;= 360 
      * @param angle the angle to normalize (in degrees)
      * @return the equivalent angle value in the range [0.0, 360.0[
Index: /applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java
===================================================================
--- /applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java	(revision 36465)
+++ /applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java	(revision 36466)
@@ -56,4 +56,5 @@
 /**
  * The action to ask the user for confirmation and then do the tagging.
+ * @since xxx added checkbox option to write GPS date and time
  */
 class GeotaggingAction extends AbstractAction implements LayerAction {
@@ -137,11 +138,14 @@
         cont.add(settingsPanel, GBC.eol().insets(3, 10, 3, 0));
 
-        final JCheckBox backups = new JCheckBox(tr("keep backup files"), Config.getPref().getBoolean(KEEP_BACKUP, true));
-        settingsPanel.add(backups, GBC.eol().insets(3, 3, 0, 0));
-
-        final JCheckBox setMTime = new JCheckBox(tr("change file modification time:"), Config.getPref().getBoolean(CHANGE_MTIME, false));
-        settingsPanel.add(setMTime, GBC.std().insets(3, 3, 5, 3));
-
-        final String[] mTimeModeArray = {"----", tr("to gps time"), tr("to previous value (unchanged mtime)")};
+        final JCheckBox cbWriteGpsTime = new JCheckBox(tr("Write EXIF GPS date and time"),  false);
+        settingsPanel.add(cbWriteGpsTime, GBC.eol().insets(3, 3, 0, 0));
+
+        final JCheckBox cbBackups = new JCheckBox(tr("Keep backup files"), Config.getPref().getBoolean(KEEP_BACKUP, true));
+        settingsPanel.add(cbBackups, GBC.eol().insets(3, 3, 0, 0));
+
+        final JCheckBox cbSetMTime = new JCheckBox(tr("Change file modification time:"), Config.getPref().getBoolean(CHANGE_MTIME, false));
+        settingsPanel.add(cbSetMTime, GBC.std().insets(3, 3, 5, 3));
+
+        final String[] mTimeModeArray = {"----", tr("to GPS time"), tr("to previous value (unchanged mtime)")};
         final JComboBox<String> mTimeMode = new JComboBox<>(mTimeModeArray);
 
@@ -153,10 +157,10 @@
             mTimeIdx = 2;
         }
-        mTimeMode.setSelectedIndex(setMTime.isSelected() ? mTimeIdx : 0);
+        mTimeMode.setSelectedIndex(cbSetMTime.isSelected() ? mTimeIdx : 0);
 
         settingsPanel.add(mTimeMode, GBC.eol().insets(3, 3, 3, 3));
 
-        setMTime.addActionListener(e -> {
-            if (setMTime.isSelected()) {
+        cbSetMTime.addActionListener(e -> {
+            if (cbSetMTime.isSelected()) {
                 mTimeMode.setEnabled(true);
             } else {
@@ -167,6 +171,6 @@
 
         // Toggle the checkbox to fire actionListener
-        setMTime.setSelected(!setMTime.isSelected());
-        setMTime.doClick();
+        cbSetMTime.setSelected(!cbSetMTime.isSelected());
+        cbSetMTime.doClick();
 
         int result = new ExtendedDialog(
@@ -183,6 +187,7 @@
             return;
 
-        final boolean keep_backup = backups.isSelected();
-        final boolean change_mtime = setMTime.isSelected();
+        final boolean write_gpstime = cbWriteGpsTime.isSelected();
+        final boolean keep_backup = cbBackups.isSelected();
+        final boolean change_mtime = cbSetMTime.isSelected();
         Config.getPref().putBoolean(KEEP_BACKUP, keep_backup);
         Config.getPref().putBoolean(CHANGE_MTIME, change_mtime);
@@ -202,9 +207,10 @@
         }
 
-        MainApplication.worker.execute(new GeoTaggingRunnable(images, keep_backup, mTimeMode.getSelectedIndex()));
+        MainApplication.worker.execute(new GeoTaggingRunnable(images, write_gpstime, keep_backup, mTimeMode.getSelectedIndex()));
     }
 
     static class GeoTaggingRunnable extends PleaseWaitRunnable {
         private final List<ImageEntry> images;
+        private final boolean write_gpstime;
         private final boolean keep_backup;
         private final int mTimeMode;
@@ -219,7 +225,8 @@
         private int currentIndex;
 
-        GeoTaggingRunnable(List<ImageEntry> images, boolean keep_backup, int mTimeMode) {
+        GeoTaggingRunnable(List<ImageEntry> images, boolean write_gpstime, boolean keep_backup, int mTimeMode) {
             super(tr("Photo Geotagging Plugin"));
             this.images = images;
+            this.write_gpstime = write_gpstime;
             this.keep_backup = keep_backup;
             this.mTimeMode = mTimeMode;
@@ -371,5 +378,5 @@
             chooseFiles(e.getFile());
             if (canceled) return;
-            ExifGPSTagger.setExifGPSTag(fileFrom, fileTo, e, lossy);
+            ExifGPSTagger.setExifGPSTag(fileFrom, fileTo, e, write_gpstime, lossy);
 
             if (mTime != null) {
@@ -538,3 +545,2 @@
     }
 }
-
Index: /applications/editors/josm/plugins/photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTaggerTest.java
===================================================================
--- /applications/editors/josm/plugins/photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTaggerTest.java	(revision 36465)
+++ /applications/editors/josm/plugins/photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTaggerTest.java	(revision 36466)
@@ -3,4 +3,5 @@
 package org.openstreetmap.josm.plugins.photo_geotagging;
 
+import static org.junit.Assert.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -23,4 +24,5 @@
 import org.openstreetmap.josm.gui.layer.geoimage.ImageEntry;
 import org.openstreetmap.josm.tools.ExifReader;
+import org.openstreetmap.josm.tools.date.DateUtils;
 
 class ExifGPSTaggerTest {
@@ -45,5 +47,5 @@
         final File out = new File(tempFolder, in.getName());
         final ImageEntry image = newImageEntry("test", 12d, 34d, Instant.now(), 12.34d, Math.E, Math.PI);
-        assertDoesNotThrow(() -> ExifGPSTagger.setExifGPSTag(in, out, image, true));
+        assertDoesNotThrow(() -> ExifGPSTagger.setExifGPSTag(in, out, image, true, true));
     }
 
@@ -63,5 +65,5 @@
         final File out = new File(tempFolder, in.getName());
         final ImageEntry image = newImageEntry("test", 12d, 34d, Instant.now(), 12.34d, Math.E, Math.PI);
-        ExifGPSTagger.setExifGPSTag(in, out, image, true);
+        ExifGPSTagger.setExifGPSTag(in, out, image, true, true);
         try {
             final Process jhead = Runtime.getRuntime().exec(new String[]{"jhead", out.getAbsolutePath()});
@@ -74,5 +76,5 @@
 
     @Test
-    public void testTicket24278() throws Exception{
+    public void testTicket24278() throws Exception {
         final File in = new File(TestUtils.getTestDataRoot(), "_DSC1234.jpg");
         final File out = new File(tempFolder, in.getName());
@@ -85,5 +87,5 @@
         image.setExifGpsDop(2.5d);
         image.setExifGpsDatum("WGS84");
-        ExifGPSTagger.setExifGPSTag(in, out, image, true);
+        ExifGPSTagger.setExifGPSTag(in, out, image, true, true);
         assertEquals(Math.PI, ExifReader.readDirection(out), 0.001);
         assertEquals(97.99, ExifReader.readGpsTrackDirection(out));
@@ -95,3 +97,17 @@
         assertEquals("WGS84", ExifReader.readGpsDatum(out));
     }
+
+    @Test
+    public void testTicket24458() throws Exception {
+        final File in = new File(TestUtils.getTestDataRoot(), "_DSC1234.jpg");
+        final File out = new File(tempFolder, in.getName());
+        final ImageEntry image = newImageEntry("test", 12d, 34d, Instant.now(), 12.34d, Math.E, Math.PI);
+        image.setGpsTime(DateUtils.parseInstant("2025:10:26 12:00:00"));
+        // Test writing EXIF GPSDateStamp and GPSTimeStamp
+        ExifGPSTagger.setExifGPSTag(in, out, image, true, true);
+        assertEquals(DateUtils.parseInstant("2025:10:26 12:00:00"), ExifReader.readGpsInstant(out));
+        // Test not writing GPSDateStamp and GPSTimeStamp
+        ExifGPSTagger.setExifGPSTag(in, out, image, false, true);
+        assertThrows(NullPointerException.class, () -> ExifReader.readGpsInstant(out));
+    }
 }
Index: /applications/editors/josm/plugins/photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingActionTest.java
===================================================================
--- /applications/editors/josm/plugins/photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingActionTest.java	(revision 36465)
+++ /applications/editors/josm/plugins/photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingActionTest.java	(revision 36466)
@@ -35,5 +35,5 @@
         List<ImageEntry> list = Arrays.asList(entry);
 
-        GeoTaggingRunnable runnable = new GeotaggingAction.GeoTaggingRunnable(list, true, 0);
+        GeoTaggingRunnable runnable = new GeotaggingAction.GeoTaggingRunnable(list, true, true, 0);
         //this causes some warnings from the PleaseWaitRunnable because not all resources are available
         //but that's irrelevant to the test
@@ -45,5 +45,5 @@
         assertEquals(0, runnable.processEntries(list, true).size());
 
-        runnable = new GeotaggingAction.GeoTaggingRunnable(list, false, 0);
+        runnable = new GeotaggingAction.GeoTaggingRunnable(list, true, false, 0);
         runnable.getProgressMonitor().beginTask("test");
         //file is now "repaired" from operation above and lossless writing should work:
