Use a different date time when normalizing zip entries

PiperOrigin-RevId: 185381597
diff --git a/third_party/ijar/test/IjarTests.java b/third_party/ijar/test/IjarTests.java
index 4676805..a2e10db 100644
--- a/third_party/ijar/test/IjarTests.java
+++ b/third_party/ijar/test/IjarTests.java
@@ -23,11 +23,11 @@
 import com.google.devtools.build.java.bazel.BazelJavaCompiler;
 import java.io.File;
 import java.io.IOException;
-import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneOffset;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Enumeration;
-import java.util.GregorianCalendar;
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
@@ -289,7 +289,7 @@
       assertThat(attributes.getValue("Injecting-Rule-Kind")).isEqualTo("foo_library");
       assertThat(jf.getEntry(JarFile.MANIFEST_NAME).getLastModifiedTime().toInstant())
           .isEqualTo(
-              Instant.ofEpochMilli(new GregorianCalendar(1980, 0, 1, 0, 0, 0).getTimeInMillis()));
+              LocalDateTime.of(2010, 1, 1, 0, 0, 0).atZone(ZoneOffset.systemDefault()).toInstant());
     }
   }
 }
diff --git a/third_party/ijar/test/ijar_test.sh b/third_party/ijar/test/ijar_test.sh
index eacf6e4..1a4959d 100755
--- a/third_party/ijar/test/ijar_test.sh
+++ b/third_party/ijar/test/ijar_test.sh
@@ -230,7 +230,7 @@
 
   # Check that -interface.jar timestamps are normalized:
   check_eq 0 $(TZ=UTC $JAR tvf $A_INTERFACE_JAR |
-               grep -v 'Tue Jan 01 00:00:00 UTC 1980' | wc -l) \
+               grep -v 'Fri Jan 01 00:00:00 UTC 2010' | wc -l) \
    "Interface jar contained non-zero timestamps!"
 
 
diff --git a/third_party/ijar/zip.cc b/third_party/ijar/zip.cc
index 957407b..c5ff929 100644
--- a/third_party/ijar/zip.cc
+++ b/third_party/ijar/zip.cc
@@ -73,7 +73,8 @@
 // http://www.info-zip.org/FAQ.html#limits
 static const u8 kMaximumOutputSize = std::numeric_limits<uint32_t>::max();
 
-static const u4 kDosEpoch = 1 << 21 | 1 << 16;  // January 1, 1980 in DOS time
+static const u4 kDefaultTimestamp =
+    30 << 25 | 1 << 21 | 1 << 16;  // January 1, 2010 in DOS time
 
 //
 // A class representing a ZipFile for reading. Its public API is exposed
@@ -873,7 +874,7 @@
   put_u2le(q, 10);  // extract_version
   put_u2le(q, 0);  // general_purpose_bit_flag
   put_u2le(q, 0);  // compression_method
-  put_u4le(q, kDosEpoch);     // last_mod_file date and time
+  put_u4le(q, kDefaultTimestamp);  // last_mod_file date and time
   put_u4le(q, entry->crc32);  // crc32
   put_u4le(q, 0);  // compressed_size
   put_u4le(q, 0);  // uncompressed_size
@@ -904,7 +905,7 @@
     put_u2le(q, ZIP_VERSION_TO_EXTRACT);  // version to extract
     put_u2le(q, 0);  // general purpose bit flag
     put_u2le(q, entry->compression_method);  // compression method:
-    put_u4le(q, kDosEpoch);                  // last_mod_file date and time
+    put_u4le(q, kDefaultTimestamp);          // last_mod_file date and time
     put_u4le(q, entry->crc32);  // crc32
     put_u4le(q, entry->compressed_length);    // compressed_size
     put_u4le(q, entry->uncompressed_length);  // uncompressed_size
@@ -995,7 +996,7 @@
   put_u2le(q, 0);                          // general purpose bit flag
   u1 *header_ptr = q;
   put_u2le(q, COMPRESSION_METHOD_STORED);  // compression method = placeholder
-  put_u4le(q, kDosEpoch);                  // last_mod_file date and time
+  put_u4le(q, kDefaultTimestamp);          // last_mod_file date and time
   put_u4le(q, entry->crc32);               // crc32
   put_u4le(q, 0);  // compressed_size = placeholder
   put_u4le(q, 0);  // uncompressed_size = placeholder