<script language="JavaScript">
var secondTime = parseInt(value);
var minuteTime = 0;
if(secondTime >60) {
//获取分钟,除以60取整数,得到整数分钟
minuteTime = parseInt(secondTime / 60);
//获取秒数,秒数取余,得到整数秒数
secondTime = parseInt(secondTime % 60);
}
var result = "" + parseInt(secondTime) + "秒";
if(minuteTime >0) {
result = "" + parseInt(minuteTime) + "分" +result;
}
return result;
}
console.log(formatSeconds(1100))
</script>