首页 > Web开发 > 详细

js获取当前时间戳,仿PHP函数模式

时间:2018-04-26 16:24:38      阅读:173      评论:0      收藏:0      [点我收藏+]

函数:

/**
 * 获取时间戳函数
 * 仿PHP函数模式
*/
function time(){
    var this_time    =    Date.parse(new Date());
        this_time    =    ‘‘+this_time;
        this_time    =    this_time.substring(0,10);
        this_time    =    parseInt(this_time);
    return this_time;
}

用法:

alert(time());

 

js获取当前时间戳,仿PHP函数模式

原文:https://www.cnblogs.com/phpyangbo/p/8952853.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!