一、創建日期對象
Paste_Image.png
二、時間轉換
Paste_Image.png
- toString()方法
2.toLocalString() 方法
3.valueOf()方法
4.測試一段代碼的執行時間
Paste_Image.png
三、獲取修改時間
Paste_Image.png
1.getFullYear() 獲取年份
2.setFullYear() 修改年份
Paste_Image.png
3.getMoth() 獲取月份
4.setMoth() 修改月份
Paste_Image.png
5.getDate() 獲取日期
6.setDate() 修改日期
Paste_Image.png
7.getDay() 獲取星期
Paste_Image.png
8.getHours() 獲取小時
9.setHours() 設置小時
Paste_Image.png
10.getMinutes() 獲取分鐘
11.setMinutes() 設置分鐘
Paste_Image.png
12.getSeconds() 獲取秒數
13.setSeconds() 設置秒數
Paste_Image.png