首页 > 代码库 > 时间戳转化

时间戳转化

1、时间戳转化
1
function getDate(uData){ 2 var myDate = new Date(uData*1000); 3 var year = myDate.getFullYear(); 4 var month = myDate.getMonth() + 1; 5 var day = myDate.getDate(); 6 var hours = myDate.getHours(); 7 var minutes = myDate.getMinutes(); 8 var second = myDate.getSeconds(); 9 return year + ‘-‘ + month + ‘-‘ + day +‘ ‘+ hours + ‘:‘ + minutes + ‘:‘ + second; 10 }

时间戳转化