From 9366e8e2088aabec2846873cef1955d9a2213010 Mon Sep 17 00:00:00 2001 From: "Esc2snap.WSL" Date: Tue, 5 Aug 2025 20:23:32 +0800 Subject: [PATCH] fix: simplify date formatting in getDate function --- scripts/new-post.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/new-post.js b/scripts/new-post.js index 253139020d..5322d19002 100644 --- a/scripts/new-post.js +++ b/scripts/new-post.js @@ -4,12 +4,7 @@ import fs from "fs" import path from "path" function getDate() { - const today = new Date() - const year = today.getFullYear() - const month = String(today.getMonth() + 1).padStart(2, "0") - const day = String(today.getDate()).padStart(2, "0") - - return `${year}-${month}-${day}` + return new Date().toISOString() } const args = process.argv.slice(2)