時間戳轉化為正常時間函數


shijianc(){
              var date = new Date(1512535620)
              // console.log(date)
              var Y = date.getFullYear() + '-'
              var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
              var D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' '
              var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
              var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':'
              var s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds())
              return Y + M + D + h + m + s

            }
    


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM