秒格式化 “秒” 为 天 时 分 秒
生活随笔
收集整理的這篇文章主要介紹了
秒格式化 “秒” 为 天 时 分 秒
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
function SecondToDate(msd) {var time =msdif (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) + "時(shí)" + 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) + "時(shí)" + 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;}
?
轉(zhuǎn)載于:https://www.cnblogs.com/candy-Yao/p/9263015.html
總結(jié)
以上是生活随笔為你收集整理的秒格式化 “秒” 为 天 时 分 秒的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [转]基于ROS平台的移动机器人-4-通
- 下一篇: 公账转私账用途怎么写