+ /*
+ * If the SOURCE_DATE_EPOCH environment variable
+ * contains a positive integer in the time_t range, use
+ * that instead of the current time. See:
+ * <https://reproducible-builds.org/specs/source-date-epoch/>
+ * for more information.
+ */
+ char *source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+ if (source_date_epoch != NULL)
+ t = strtoll(source_date_epoch, NULL, 10);
+ if (t <= 0)
+ t = time(NULL);
+ tmp = gmtime(&t);