js时间戳13位转日期格式
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                js时间戳13位转日期格式
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                
                            
                            
                            getTime(timestamp) {var date = new Date(parseInt(timestamp) * 1000);//時間戳為13位的話需要parseInt下const Y = date.getFullYear() + '-';const M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';const D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) + ' ';const h = (date.getHours() < 10 ? '0'+date.getHours() : date.getHours()) + ':';const m = (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes()) + ':';const s = (date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds());return Y+M+D+h+m+s;}, 
                            
                        
                        
                        總結
以上是生活随笔為你收集整理的js时间戳13位转日期格式的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: iqooneo3 如何不用vivo账号下
- 下一篇: java获取实体类对象_java 获取实
