From 96270cd1cc864c46417874441bdece24b70e8710 Mon Sep 17 00:00:00 2001 From: cjc7373 Date: Wed, 2 Feb 2022 22:53:56 +0800 Subject: [PATCH] fix(route): zhihu posts pubDate (#8947) --- lib/routes/zhihu/posts.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/routes/zhihu/posts.js b/lib/routes/zhihu/posts.js index 03149fd72c..6d9181bce8 100644 --- a/lib/routes/zhihu/posts.js +++ b/lib/routes/zhihu/posts.js @@ -1,6 +1,7 @@ const got = require('@/utils/got'); const utils = require('./utils'); const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); module.exports = async (ctx) => { const id = ctx.params.id; @@ -38,7 +39,7 @@ module.exports = async (ctx) => { title: String(item.title), description: item.content, link: item.url, - pubDate: new Date(item.updated).toUTCString(), + pubDate: parseDate(item.updated * 1000), })), }; };