Node.js 在当地时间快速打印日志?

Node.js 在当地时间快速打印日志?,node.js,fastify,Node.js,Fastify,我已经知道如何在fastfy中漂亮地打印日志: const server = fastify({ logger: { prettyPrint: __DEV__ && { translateTime: 'h:MM:ss TT', colorize: true, ignore: 'pid,hostname' }, }, }) 但时间是UTC。如何在本地时间获取或指

我已经知道如何在
fastfy
中漂亮地打印日志:

const server = fastify({
    logger: {
        prettyPrint: __DEV__ && {
            translateTime: 'h:MM:ss TT',
            colorize: true,
            ignore: 'pid,hostname'
        },
    },
})

但时间是UTC。如何在本地时间获取或指定时区?

使用
pino-pretty@4
您需要设置:

translateTime: 'SYS:h:MM:ss TT Z o',
可以使用json选项设置所有的参数