![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JavaScript
qq_27519673
这个作者很懒,什么都没留下…
展开
-
Javascript 检查字符串是否是数字的几种方法
//判断是否是正整数 function IsNum(s) { if(s!=null){ var r,re; re = /\d*/i; //\d表示数字,*表示匹配多个数字 r = s.match(re); return (r==s)?true:false; } return false;转载 2016-03-18 12:47:30 · 315 阅读 · 0 评论 -
javascript时间戳和日期字符串相互转换
// 获取当前时间戳(以s为单位) var timestamp = Date.parse(new Date()); timestamp = timestamp / 1000; //当前时间戳为:1403149534 console.log("当前时间戳为:" + timestamp); // 获取某个时间格式的时间戳 var stringTime = "2014-07-10 1转载 2016-09-08 16:29:57 · 192 阅读 · 0 评论