正文

JavaScript中转换时间格式的方法多样,以下是一些常见的方法: 1. 使用`Date`对象: ```javascript let date = new Date(); let year = date.getFullYear(); let month = date.getMonth() + 1; // 月份是从0开始的,所以要加1 let day =