謝晒的PHP網頁設計
聯絡E-mail:
sean0704@gmail.com
站內搜尋
Friday, October 20, 2023
[JavaScript] 超簡單找出某個時間的上一個月的日期
const date = new Date("2023-01-03");
date.setMonth(date.getMonth() - 1);
// 輸出上一個月的日期
console.log('上一個月的日期: ' + date.toISOString().slice(0, 10));
No comments:
Post a Comment
Newer Post
Older Post
Home
View mobile version
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment