functionadd0(m){returnm<10?'0'+m:m }functionformat(shijianchuo)
{//shijianchuo是整数,否则要parseInt转换vartime =newDate(shijianchuo);vary =time.getFullYear();varm = time.getMonth()+1;vard =time.getDate();varh =time.getHours();varmm =time.getMinutes();vars =time.getSeconds();returny+'-'+add0(m)+'-'+add0(d)+' '+add0(h)+':'+add0(mm)+':'+add0(s);
}
网友评论