Index: src/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTagger.java
===================================================================
--- src/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTagger.java	(revision 36462)
+++ src/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTagger.java	(working copy)
@@ -41,15 +41,17 @@
      * @param imageFile A source image file.
      * @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
             throw new IOException(tr("Read/write error: " + ire.getMessage()), ire);
@@ -57,7 +59,7 @@
     }
 
     public static void setExifGPSTagWorker(File imageFile, File dst, ImageEntry imageEntry,
-            boolean lossy) throws IOException {
+            boolean writeGpsTime, boolean lossy) throws IOException {
 
         TiffOutputSet outputSet = null;
         ImageMetadata metadata = Imaging.getMetadata(imageFile);
@@ -79,7 +81,7 @@
         gpsDirectory.removeField(GpsTagConstants.GPS_TAG_GPS_VERSION_ID);
         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());
 
Index: src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java
===================================================================
--- src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java	(revision 36462)
+++ src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java	(working copy)
@@ -55,6 +55,7 @@
 
 /**
  * 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 {
 
@@ -136,13 +137,16 @@
         settingsPanel.setBorder(BorderFactory.createTitledBorder(tr("settings")));
         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 cbWriteGpsTime = new JCheckBox(tr("Write EXIF GPS date and time"),  false);
+        settingsPanel.add(cbWriteGpsTime, 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 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 String[] mTimeModeArray = {"----", tr("to gps time"), tr("to previous value (unchanged mtime)")};
+        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);
 
         String mTimeModePrefName = Config.getPref().get(MTIME_MODE, null);
@@ -152,12 +156,12 @@
         } else if ("previous".equals(mTimeModePrefName)) {
             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 {
                 mTimeMode.setSelectedIndex(0);
@@ -166,8 +170,8 @@
         });
 
         // Toggle the checkbox to fire actionListener
-        setMTime.setSelected(!setMTime.isSelected());
-        setMTime.doClick();
+        cbSetMTime.setSelected(!cbSetMTime.isSelected());
+        cbSetMTime.doClick();
 
         int result = new ExtendedDialog(
                 MainApplication.getMainFrame(),
@@ -182,8 +186,9 @@
         if (result != 1)
             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);
         if (change_mtime) {
@@ -201,11 +206,12 @@
             Config.getPref().put(MTIME_MODE, mTimeModePref);
         }
 
-        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;
 
@@ -218,9 +224,10 @@
 
         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;
         }
@@ -370,7 +377,7 @@
 
             chooseFiles(e.getFile());
             if (canceled) return;
-            ExifGPSTagger.setExifGPSTag(fileFrom, fileTo, e, lossy);
+            ExifGPSTagger.setExifGPSTag(fileFrom, fileTo, e, write_gpstime, lossy);
 
             if (mTime != null) {
                 if (!fileTo.setLastModified(mTime.toEpochMilli()))
@@ -536,5 +543,4 @@
     public boolean supportLayers(List<Layer> layers) {
         return layers.size() == 1 && layers.get(0) instanceof GeoImageLayer;
     }
-}
-
+}
\ No newline at end of file
Index: test/unit/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTaggerTest.java
===================================================================
--- test/unit/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTaggerTest.java	(revision 36462)
+++ test/unit/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTaggerTest.java	(working copy)
@@ -2,6 +2,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 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;
 
@@ -22,6 +23,7 @@
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.gui.layer.geoimage.ImageEntry;
 import org.openstreetmap.josm.tools.ExifReader;
+import org.openstreetmap.josm.tools.date.DateUtils;
 
 class ExifGPSTaggerTest {
 
@@ -44,7 +46,7 @@
         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);
-        assertDoesNotThrow(() -> ExifGPSTagger.setExifGPSTag(in, out, image, true));
+        assertDoesNotThrow(() -> ExifGPSTagger.setExifGPSTag(in, out, image, true, true));
     }
 
     @Test
@@ -62,7 +64,7 @@
         final File in = new File(TestUtils.getTestDataRoot(), "IMG_7250_small.JPG");
         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()});
             assertEquals(jhead.getErrorStream().available(), 0);
@@ -73,7 +75,7 @@
     }
 
     @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());
         final ImageEntry image = newImageEntry("test", 12d, 34d, Instant.now(), 12.34d, Math.E, Math.PI);
@@ -84,7 +86,7 @@
         image.setExifHPosErr(1.2d);
         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));
         assertEquals(1, ExifReader.readGpsDiffMode(out));
@@ -94,4 +96,18 @@
         assertEquals(2.5, ExifReader.readGpsDop(out));
         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: test/unit/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingActionTest.java
===================================================================
--- test/unit/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingActionTest.java	(revision 36462)
+++ test/unit/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingActionTest.java	(working copy)
@@ -34,7 +34,7 @@
         entry.setPos(new LatLon(1, 2));
         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
         runnable.getProgressMonitor().beginTask("test");
@@ -44,7 +44,7 @@
         //test if overriding backup works:
         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:
         assertEquals(0, runnable.processEntries(list, false).size());
