functionCurentTime() { var now = newDate(); //获取当前时间 var year = now.getFullYear(); //年 var month = now.getMonth() + 1; //月 var day = now.getDate(); //日 var hh = now.getHours(); //时 var mm = now.getMinutes(); //分
functiondateConvert(date, format) { date = parseInt(date); varUdate = newDate(date); var Y = Udate.getFullYear(), M = (Udate.getMonth() + 1) < 10 ? "0" + (Udate.getMonth() + 1) : (Udate.getMonth() + 1), D = Udate.getDate() < 10 ? "0" + Udate.getDate() : Udate.getDate(), h = Udate.getHours(), m = Udate.getMinutes(), s = Udate.getSeconds();
if (!format) { format = "Y/M/D h:m:s"; }
if (format.indexOf("Y") >= 0) { format = format.replace("Y", Y); } if (format.indexOf("M") >= 0) { format = format.replace("M", M); } if (format.indexOf("D") >= 0) { format = format.replace("D", D); } if (format.indexOf("h") >= 0) { format = format.replace("h", h); } if (format.indexOf("m") >= 0) { format = format.replace("m", m); } if (format.indexOf("s") >= 0) { format = format.replace("s", s); }