1. 程式人生 > >js 格式化時間日期函式小結

js 格式化時間日期函式小結

format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));