--- src/core/ngx_times.c.orig	2017-07-11 14:24:07.000000000 +0100
+++ src/core/ngx_times.c	2017-08-28 02:01:46.437347000 +0100
@@ -304,7 +304,11 @@
 
     /* the calculation is valid for positive time_t only */
 
-    n = (ngx_uint_t) t;
+    if (t < 0) {
+        n = 0;
+    } else {
+        n = (ngx_uint_t) t;
+    }
 
     days = n / 86400;
 
