js格式化日期如何實現
2023-06-12 17:37:47 閱讀(122)
Js獲取當前日期時間及格式化代碼?
若傳入的對象是:1366853842000var tmp = dt.toString().replace(/\/Date\((\d+)\)\//gi, "$1") ;var time = new Date(Math.abs(tmp));這time變量就為Date()類型了;---Date對象的方法: time.getFullYear():獲取4位年份; time.getMonth():獲取月份。從0開始記,所以要+1; time.getDate():獲取 日; time.getHours():獲取 小時; time.getMinutes():獲取 分鐘; time.getSeconds():獲取 秒數;
未經允許不得轉載,或轉載時需注明出處











































注冊有好禮





















川公網安備 51010402000322號

快速找產品






400-0033-166
8:30-18:00



