8
Follow
1392
Followers
Código práctico de JavaScript: conversión de milisegundos a una duración legible
Created 2018-04-24 15:21:28 Updated 2018-04-24 15:21:55
0
2092
Pequeño código práctico
Conversión de milisegundos a tiempo de lectura
function MillisecondToDate(msd) {
var time = parseFloat(msd) / 1000;
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 {
time = parseInt(time) + "秒"
}
}else{
time = "0 时 0 分0 秒"
}
return time
}
Related Recommendations
The grid trading strategyPython streamlined multi-variety MACD trending strategy frameworkin main TypeError: IO() takes at most 3 arguments (5 given)symbol not setGetTicker: 400: {"code": 2, "data": {}, "message": "invalid params"}gateio getdepth 502Decrypt: Secret key decrypt failedGetOrders: 400: {"code":-1121,"msg":"Invalid symbol."}HTTP 403 errorBitcoin trading by using bots
Comment
All comments (0)
No data
- 1
