[mirotalksfu] - improve TZ add ms

هذا الالتزام موجود في:
Miroslav Pejic
2024-02-22 17:32:52 +01:00
الأصل 0d152c13a1
التزام fb319e8681

عرض الملف

@@ -19,6 +19,10 @@ module.exports = class Logger {
this.timeStart = Date.now();
this.timeEnd = null;
this.timeElapsedMs = null;
this.tmOptions = {
timeZone: process.env.TZ || config.console.timeZone || 'UTC',
hour12: false,
};
}
debug(msg, op = '') {
@@ -60,10 +64,9 @@ module.exports = class Logger {
}
getDateTime() {
const options = {
timeZone: process.env.TZ || config.console.timeZone || 'UTC',
};
return colors.cyan(new Date().toLocaleString('en-US', options));
const currentTime = new Date().toLocaleString('en-US', this.tmOptions);
const milliseconds = String(new Date().getMilliseconds()).padStart(3, '0');
return colors.cyan(`${currentTime}:${milliseconds}`);
}
getFormatTime(ms) {