From d58394e1bdd3ca4831fbd8488b5eca76f2e7f357 Mon Sep 17 00:00:00 2001 From: Yuzu Date: Mon, 17 Feb 2025 22:33:39 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20beautify=20date=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 33959e6..2fd658c 100644 --- a/index.js +++ b/index.js @@ -40,7 +40,21 @@ async function getGitHash() { async function updateAPIMetadata() { console.log("Updating API Metadata..."); try { - const currentDate = new Date().toISOString(); + const date = new Date(); + + const offsetedTime = new Date(date.getTime() + 7 * 60 * 60 * 1000); + const currentDate = offsetedTime + .toLocaleString("en-US", { + timeZone: "Etc/GMT-7", + month: "2-digit", + day: "2-digit", + year: "numeric", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + hour12: false, + }) + .replace(",", ""); console.log(`Current timestamp: ${currentDate}`); sheets.spreadsheets.values.update({