From 0ce853c1474d853aac61182f1e8ac852b8da5975 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 28 Apr 2014 09:24:02 -0400 Subject: [PATCH] feature(util) change format of date in logs --- lib/util.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/util.js b/lib/util.js index ad856671..aac3c5fc 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1013,13 +1013,26 @@ * Gets current date in format yy.mm.dd hh:mm:ss */ this.getDate = function() { - var date = new Date(), + var date = Util.getShortDate(), + time = Util.getTime(), + ret = date + ' ' + time; + + return ret; + }; + + this.getShortDate = function() { + var ret, + date = new Date(), day = date.getDate(), month = date.getMonth() + 1, - year = date.getFullYear(), - lRet = year + '-' + month + '-' + day + ' ' + Util.getTime(); + year = date.getFullYear(); + + if (month <= 9) + month = '0' + month; - return lRet; + ret = year + '.' + month + '.' + day; + + return ret; }; }