util: output Dates with Date.toString not Date.toUTCString

This commit is contained in:
Avi Flax 2011-12-18 11:29:37 -05:00 committed by Ben Noordhuis
parent b084322f52
commit ee0a7b928b
2 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ function formatValue(ctx, value, recurseTimes) {
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
} }
if (isDate(value)) { if (isDate(value)) {
return ctx.stylize(Date.prototype.toUTCString.call(value), 'date'); return ctx.stylize(Date.prototype.toString.call(value), 'date');
} }
if (isError(value)) { if (isError(value)) {
return formatError(value); return formatError(value);

View File

@ -31,7 +31,7 @@ assert.equal('[Function]', common.inspect(function() {}));
assert.equal('undefined', common.inspect(undefined)); assert.equal('undefined', common.inspect(undefined));
assert.equal('null', common.inspect(null)); assert.equal('null', common.inspect(null));
assert.equal('/foo(bar\\n)?/gi', common.inspect(/foo(bar\n)?/gi)); assert.equal('/foo(bar\\n)?/gi', common.inspect(/foo(bar\n)?/gi));
assert.equal('Sun, 14 Feb 2010 11:48:40 GMT', assert.equal('Sun Feb 14 2010 12:48:40 GMT+0100 (CET)',
common.inspect(new Date('Sun, 14 Feb 2010 11:48:40 GMT'))); common.inspect(new Date('Sun, 14 Feb 2010 11:48:40 GMT')));
assert.equal("'\\n\\u0001'", common.inspect('\n\u0001')); assert.equal("'\\n\\u0001'", common.inspect('\n\u0001'));