use asia/shanghai timezone to format published date in wechat articles

This commit is contained in:
Hongbo Wu 2023-07-04 20:46:39 +08:00
parent ccc69d01d5
commit a818fa721c

View file

@ -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')