zoukankan      html  css  js  c++  java
  • 如何把秒数转换为年月日时分秒

    function getDateStr(seconds){
        var date = new Date(seconds*1000)
            var year = date.getFullYear();
            var month = date.getMonth() + 1;
            var day = date.getDate();
            var hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
            var minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
            var second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
            var currentTime = year + "-" + month + "-" + day + "  " + hour + ":" + minute + ":" + second;
            return currentTime
    }
    //getDateStr(1524637692)>"2018-4-25  14:28:12"
  • 相关阅读:
    flush logs
    slave-skip-errors,sql_slave_skip_counter
    稀饭
    table
    profiles
    索引使用规范
    innodb_rollback_on_timeout
    mysql账号管理
    跨库复制
    linux.sh
  • 原文地址:https://www.cnblogs.com/-walker/p/8949696.html
Copyright © 2011-2022 走看看