美文网首页H5教程集合
毫秒级时间戳转换封装

毫秒级时间戳转换封装

作者: 余生社会 | 来源:发表于2018-03-14 10:27 被阅读4次

    const dateFormat = (time) => {
    var date = new Date()
    date.setTime(time)
    var timeString = date.getFullYear() + "年" + date.getMonth() + 1 + "月" + date.getDay() + "日" + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds()
    return timeString
    }

    相关文章

      网友评论

        本文标题:毫秒级时间戳转换封装

        本文链接:https://www.haomeiwen.com/subject/huoxqftx.html