js时间转化

时间:2014-09-19 11:38:15   收藏:0   阅读:319
function showDiv(objID){
	  //将时间转化为时间戳
	  var str = ‘2009/1/1‘;
          var ftime = str.replace(/-/g,‘/‘);
          var uftime = Date.parse(ftime)/1000;
	  //将当前时间转化为时间戳
	  var curtime = Math.round(new Date().getTime()/1000.0);
	  //alert(curtime);
    }

  

原文:http://www.cnblogs.com/longailili/p/3980926.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!