简介

RT

code

            var time = 1595058723;
            var unixTimestamp = new Date(time * 1000)
            commonTime = unixTimestamp.toLocaleString('en-GB', { hour12: false })
            var tim = commonTime.split('\/')
            var year = tim[2].split(',')[0]
            var month = tim[1]
            var day = tim[0]
            var tt = tim[2].split(',')[1]
            console.log(year + '/' + month + '/' + day + tt)

Result

2020/07/18 15:52:03

posted on 2020-07-18 16:22  HDU李少帅  阅读(165)  评论(0编辑  收藏  举报