--- apache-ant-1.10.14/src/main/org/apache/tools/ant/taskdefs/Javadoc.java	2024-08-13 16:34:16.694518372 +0200
+++ apache-ant-1.10.14/src/main/org/apache/tools/ant/taskdefs/Javadoc.java	2024-08-13 16:36:49.825656246 +0200
@@ -1807,6 +1807,16 @@
      */
     @Override
     public void execute() throws BuildException {
+        if (System.getenv("SOURCE_DATE_EPOCH") != null) {
+            java.util.List<String> arguments = java.util.Arrays.asList(cmd.getCommandline());
+            if (!arguments.contains("-locale")) {
+                setLocale("en");
+            }
+            if (!arguments.contains("-encoding")) {
+                setEncoding("UTF-8");
+            }
+        }
+
         checkTaskName();
 
         final List<String> packagesToDoc = new Vector<>();
@@ -2013,6 +2023,10 @@
             toExecute.createArgument().setValue("-author");
         }
 
+        if (System.getenv("SOURCE_DATE_EPOCH") != null && doclet == null) {
+            toExecute.createArgument().setValue("-notimestamp");
+        }
+
         if (doclet == null && destDir == null) {
             throw new BuildException("destdir attribute must be set!");
         }