From e39283458e80d65cf3cb5b7909034da4eb53c40c Mon Sep 17 00:00:00 2001 From: Dongfang Zhao Date: Sat, 13 May 2023 22:27:28 -0700 Subject: [PATCH] Use local time zone automatically --- lib/notion/getPostBlocks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/notion/getPostBlocks.js b/lib/notion/getPostBlocks.js index 8e764f7b..ca3090dd 100644 --- a/lib/notion/getPostBlocks.js +++ b/lib/notion/getPostBlocks.js @@ -40,7 +40,7 @@ export async function getPageWithRetry(id, from, retryAttempts = 3) { console.log('[请求API]', `from:${from}`, `id:${id}`, retryAttempts < 3 ? `剩余重试次数:${retryAttempts}` : '') try { const authToken = BLOG.NOTION_ACCESS_TOKEN || null - const api = new NotionAPI({ authToken, userTimeZone: 'Asia/ShangHai' }) + const api = new NotionAPI({ authToken, userTimeZone: Intl.DateTimeFormat().resolvedOptions().timeZone }) const pageData = await api.getPage(id) console.info('[响应成功]:', `from:${from}`) return pageData