diff --git a/lib/util.js b/lib/util.js index 63d6d0f3c865af..02a9b64c90f53e 100644 --- a/lib/util.js +++ b/lib/util.js @@ -304,7 +304,11 @@ function formatValue(ctx, value, recurseTimes) { return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); } if (isDate(value)) { - return ctx.stylize(Date.prototype.toISOString.call(value), 'date'); + if (value.toString() === 'Invalid Date') { + return ctx.stylize('Invalid Date', 'date'); + } else { + return ctx.stylize(Date.prototype.toISOString.call(value), 'date'); + } } if (isError(value)) { return formatError(value);