summaryrefslogtreecommitdiff
path: root/lib/sys.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sys.js')
-rw-r--r--lib/sys.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sys.js b/lib/sys.js
index 581af38dfe..65badcdc05 100644
--- a/lib/sys.js
+++ b/lib/sys.js
@@ -59,6 +59,11 @@ exports.inspect = function (obj, showHidden) {
}
}
+ // Dates without properties can be shortcutted
+ if (value instanceof Date && keys.length === 0) {
+ return value.toUTCString();
+ }
+
var base, type, braces;
// Determine the object type
if (value instanceof Array) {
@@ -75,6 +80,11 @@ exports.inspect = function (obj, showHidden) {
} else {
base = "";
}
+
+ // Make dates with properties first say the date
+ if (value instanceof Date) {
+ base = ' ' + value.toUTCString();
+ }
seen.push(value);