js 时间戳转化为时间
作者:互联网
// 时间戳转为时间 bb="xxxx";//时间戳 var date = new Date(bb); Y = date.getFullYear() + '-'; M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'; D = date.getDate() + ' '; h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours())+':'; m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes())+':'; s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); var getdatetime = (Y+M+D+h+m+s);
标签:10,getMinutes,getSeconds,getHours,js,转化,时间,date,getMonth 来源: https://www.cnblogs.com/Ananiah/p/10809664.html