Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
router.use(function(req, res, next) {
count++;
console.log('['+count+'] at: '+format.asString('hh:mm:ss.SSS', new Date())+' Url is: ' + req.url);
next(); // make sure we go to the next routes and don't stop here
});
router.use(function(req, res, next) {
count++;
console.log('['+count+'] at: '+format.asString('hh:mm:ss.SSS', new Date())+' Url is: ' + req.url);
next(); // make sure we go to the next routes and don't stop here
});
router.use(function(req, res, next) {
count++;
console.log('['+count+'] at: '+format.asString('hh:mm:ss.SSS', new Date())+' Url is: ' + req.url);
next(); // make sure we go to the next routes and don't stop here
});
router.use(function(req, res, next) {
count++;
console.log('['+count+'] at: '+format.asString('hh:mm:ss.SSS', new Date())+' Url is: ' + req.url);
next(); // make sure we go to the next routes and don't stop here
});
let format = dateFormat.ISO8601_FORMAT;
if (specifier) {
format = specifier;
// Pick up special cases
if (format === 'ISO8601') {
format = dateFormat.ISO8601_FORMAT;
} else if (format === 'ISO8601_WITH_TZ_OFFSET') {
format = dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT;
} else if (format === 'ABSOLUTE') {
format = dateFormat.ABSOLUTETIME_FORMAT;
} else if (format === 'DATE') {
format = dateFormat.DATETIME_FORMAT;
}
}
// Format the date
return dateFormat.asString(format, loggingEvent.startTime);
}
let format = dateFormat.ISO8601_FORMAT;
if (specifier) {
format = specifier;
// Pick up special cases
if (format === 'ISO8601') {
format = dateFormat.ISO8601_FORMAT;
} else if (format === 'ISO8601_WITH_TZ_OFFSET') {
format = dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT;
} else if (format === 'ABSOLUTE') {
format = dateFormat.ABSOLUTETIME_FORMAT;
} else if (format === 'DATE') {
format = dateFormat.DATETIME_FORMAT;
}
}
// Format the date
return dateFormat.asString(format, loggingEvent.startTime);
}
function writeExpense (expenseObjectParam) {
var xdgBasedir = require('xdg-basedir');
var expensesFilepath = xdgBasedir.data + '/wallet/expenses.csv';
var fs = require('fs');
var logSymbols = require('log-symbols');
var prettyDate = require('date-format').asString('yyyy-MM-dd', new Date());
var record = [
prettyDate,
expenseObjectParam.reason,
expenseObjectParam.category,
expenseObjectParam.credit,
expenseObjectParam.debit
].join(delimiter);
fs.appendFile(expensesFilepath, record + '\n', function (err) {
if (err) {
throw (err);
} else {
console.log('\n' + logSymbols.success + ' Expense written to file!' + '\n');
}
});
static format(date, format="yyyy-MM-dd hh:mm:ss") {
if (!date) return "-";
return DateFormat.asString(format, date);
}
export const formatTime = (time,type) => {
let zh = ["日", "一", "二", "三", "四", "五", "六"];
let date = new Date(time * 1000);
let oneWeekTime = 7 * 24 * 60 * 60 * 1000;
let result = type === 'mm-dd' ? format.asString('MM-dd', date) :format.asString('yyyy-MM-dd hh:mm', date) + ' 星期' + zh[date.getDay()]
return Date.now() - date>=oneWeekTime ?
result
:
timeago().format(date)
}
export const getArticleInfo = detailArr => {
function startTime(loggingEvent) {
return dateFormat.asString('hh:mm:ss', loggingEvent.startTime);
}