diff --git a/lib/internal/http.js b/lib/internal/http.js index 081f13c0b95e91..b17687d4d81624 100644 --- a/lib/internal/http.js +++ b/lib/internal/http.js @@ -5,7 +5,6 @@ const { Date, DatePrototypeGetMilliseconds, DatePrototypeToUTCString, - DatePrototypeValueOf, } = primordials; const { setUnrefTimeout } = require('internal/timers'); @@ -20,8 +19,8 @@ function utcDate() { function cache() { const d = new Date(); - utcCache = d.toUTCString(); - setUnrefTimeout(resetCache, 1000 - d.getMilliseconds()); + utcCache = DatePrototypeToUTCString(d); + setUnrefTimeout(resetCache, 1000 - DatePrototypeGetMilliseconds(d)); } function resetCache() {