/**
* 把时间转换为整数
*/
convertTimeToInt : function(time){
var result = null;
if(time != null && time != ""){
result = parseInt(time.replace(/-/g,"").replace(/:/g,""),10);
}
return result;
},
// 获取当前时间hhmm的比较值
getOraNowTimeInt : function(){
var now = jAnXin.util.formatDate(new Date(), "hh:mm");
return this.convertTimeToInt(now);
},
本文介绍了一个将时间字符串转换为整数的JavaScript函数,并展示了如何获取当前时间的hh:mm格式并转换为整数。适用于日期时间处理相关的前端开发场景。
&spm=1001.2101.3001.5002&articleId=82541933&d=1&t=3&u=4eb7ed64213f4bd0850a0a4b2695636b)
2721

被折叠的 条评论
为什么被折叠?



