From a818fa721c033a7c87eeb6df662f9e7a161e8204 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Tue, 4 Jul 2023 20:46:39 +0800 Subject: [PATCH] use asia/shanghai timezone to format published date in wechat articles --- packages/content-handler/src/websites/weixin-qq-handler.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/content-handler/src/websites/weixin-qq-handler.ts b/packages/content-handler/src/websites/weixin-qq-handler.ts index 35006cd50..7b49ae3eb 100644 --- a/packages/content-handler/src/websites/weixin-qq-handler.ts +++ b/packages/content-handler/src/websites/weixin-qq-handler.ts @@ -16,10 +16,9 @@ export class WeixinQqHandler extends ContentHandler { const publishTime = dom.querySelector('#publish_time')?.textContent if (publishTime) { const dateTimeFormat = 'yyyy-LL-dd HH:mm' - const publishTimeISO = DateTime.fromFormat( - publishTime, - dateTimeFormat - ).toISO() + const publishTimeISO = DateTime.fromFormat(publishTime, dateTimeFormat, { + zone: 'Asia/Shanghai', + }).toISO() // create a meta node to store the publish time in ISO format const metaNode = dom.createElement('meta')