How can I change timezone in this code? I tried some codes but it was unsuccess for me. I wrote some function for this. Like;
const timezoned = () => {
return new Date().toLocaleString('en-US', {
timeZone: 'Europe/Istanbul'
});
This is my Code;
const winston = require('winston');
const { format, level, prettyPrint } = require('winston');
require('winston-daily-rotate-file');
var transport = new (winston.transports.DailyRotateFile)({
filename: 'application-%DATE%.log',
datePattern: 'YYYY-MM-DD-HH',
zippedArchive: true,
maxSize: '1g',
format:format.combine(format.timestamp(),format.prettyPrint()),
level: 'info'
});
transport.on('rotate', function(oldFilename, newFilename) {
// do something fun
});
var logger = winston.createLogger({
transports: [
transport
]
});
};
module.exports.logger = logger;