zoukankan      html  css  js  c++  java
  • js 中 时间戳转换为时间

    切记 php的时间戳 要乘以1000 changeTimeFormat(value.ctime*1000) [js] function changeTimeFormat(time) { var date = new Date(time); var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1; var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate(); var hh = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(); var mm = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(); return date.getFullYear() + "-" + month + "-" + currentDate+" "+hh + ":" + mm; //返回格式:yyyy-MM-dd hh:mm } [/js]
  • 相关阅读:
    node
    ionic
    关于websocket和ajax无刷新
    HTML图片热区
    npm -D -S -g -i 以及安装技巧
    es6 webpack转es5
    es6
    es6
    ssh tunnel
    vim上次和下次光标位置
  • 原文地址:https://www.cnblogs.com/freefei/p/3234986.html
Copyright © 2011-2022 走看看