Javascript gets today’s date in ISO format and is not affected by time zone

// Get today's date
let today = new Date();
today.setUTCHours(0, 0, 0, 0);

let isoDate = today.toISOString().substring(0, 10);
console.log(isoDate);
Result:
2023-04-18

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *