From: Cristy Date: Mon, 15 Apr 2019 14:24:50 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.8-41~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f283bf9632534bec32031fe602f49920ba079d7f;p=imagemagick ... --- diff --git a/MagickCore/timer.c b/MagickCore/timer.c index ca2d16bb0..faa113bf2 100644 --- a/MagickCore/timer.c +++ b/MagickCore/timer.c @@ -48,6 +48,7 @@ #include "MagickCore/memory_.h" #include "MagickCore/memory-private.h" #include "MagickCore/nt-base-private.h" +#include "MagickCore/string-private.h" #include "MagickCore/timer.h" #include "MagickCore/timer-private.h" @@ -357,6 +358,18 @@ MagickExport double GetElapsedTime(TimerInfo *time_info) */ MagickPrivate time_t GetMagickTime(void) { + char + *source_date_epoch = getenv("SOURCE_DATE_EPOCH"); + + if (source_date_epoch != (char *) NULL) + { + time_t + epoch; + + epoch=(time_t) StringToDouble(source_date_epoch,(char **) NULL); + if ((epoch > 0) && (epoch <= time((time_t *) NULL))) + return(epoch); + } return(time((time_t *) NULL)); }