From 5b36e0b70d578c07c099ae2199e2ebc4f436a0fa Mon Sep 17 00:00:00 2001 From: Sean Chao Date: Sat, 27 Nov 2021 15:28:27 +0800 Subject: [PATCH] fix: infzm timezone (#7695) --- lib/routes/infzm/news.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/routes/infzm/news.js b/lib/routes/infzm/news.js index 4ed89f811..5759a289b 100644 --- a/lib/routes/infzm/news.js +++ b/lib/routes/infzm/news.js @@ -1,4 +1,5 @@ const got = require('@/utils/got'); +const timezone = require('@/utils/timezone'); const cheerio = require('cheerio'); const baseUrl = 'http://www.infzm.com/contents'; @@ -16,7 +17,8 @@ module.exports = async (ctx) => { const data = response.data.data; const resultItem = await Promise.all( data.contents.map(async ({ id, subject, author, publish_time }) => { - const date = new Date(publish_time); + // the timezone is GMT+8 + const date = timezone(publish_time, +8); const link = `http://www.infzm.com/contents/${id}`; let description = '';