zoukankan      html  css  js  c++  java
  • JS将秒转换为 天

    function SecondToDate(msd) {
                var time =msd
                if (null != time && "" != time) {
                    if (time > 60 && time < 60 * 60) {
                        time = parseInt(time / 60.0) + "分钟" + parseInt((parseFloat(time / 60.0) -
                            parseInt(time / 60.0)) * 60) + "秒";
                    }
                    else if (time >= 60 * 60 && time < 60 * 60 * 24) {
                        time = parseInt(time / 3600.0) + "小时" + parseInt((parseFloat(time / 3600.0) -
                            parseInt(time / 3600.0)) * 60) + "分钟" +
                            parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) -
                            parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒";
                    else if (time >= 60 * 60 * 24) {
                        time = parseInt(time / 3600.0/24) + "天" +parseInt((parseFloat(time / 3600.0/24)-
                            parseInt(time / 3600.0/24))*24) + "小时" + parseInt((parseFloat(time / 3600.0) -
                            parseInt(time / 3600.0)) * 60) + "分钟" +
                            parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) -
                            parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒";
                    }
                    else {
                        time = parseInt(time) + "秒";
                    }
                }
                return time;
            }
  • 相关阅读:
    Enables DNS lookups on client IP addresses 域名的分层结构
    移除 URL 中的 index.php
    Design and Architectural Goals
    The Model represents your data structures.
    If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
    UNION WHERE
    cookie less
    http 2
    UNION DISTINCT
    联合约束 CONCAT()
  • 原文地址:https://www.cnblogs.com/shitaotao/p/7624614.html
Copyright © 2011-2022 走看看