diff --git a/src/utils/ids.js b/src/utils/ids.js index e8a253b..9b02141 100755 --- a/src/utils/ids.js +++ b/src/utils/ids.js @@ -90,9 +90,9 @@ function AddVisitStat(name, subj, newQuestions, allQuestions) { var date = new Date() const now = date.getFullYear() + - '/' + + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + - '/' + + '-' + ('0' + date.getDate()).slice(-2) if (vData[now] === undefined) { vData[now] = {} diff --git a/src/utils/logger.js b/src/utils/logger.js index d87aa76..3f0b6b2 100755 --- a/src/utils/logger.js +++ b/src/utils/logger.js @@ -47,7 +47,7 @@ const uvStatsFile = 'stats/uvstats' const nologFile = './nolog' const colors = ['green', 'red', 'yellow', 'blue', 'magenta', 'cyan'] -var logFileName = getDayString() +var logFileName = utils.GetDateString(true) const writeInterval = 10 const debugLevel = parseInt(process.env.NS_LOGLEVEL) || 0 @@ -61,18 +61,7 @@ let writes = 0 let noLogips = [] function setNewLogfileName() { - logFileName = getDayString() -} - -function getDayString() { - const date = new Date() - return ( - date.getFullYear() + - '_' + - ('0' + (date.getMonth() + 1)).slice(-2) + - '_' + - ('0' + date.getDate()).slice(-2) - ) + logFileName = utils.GetDateString(true) } function GetDateString() {