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

函数:

/**
 * 获取时间戳函数
 * 仿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());
原文地址:https://www.cnblogs.com/phpyangbo/p/8952853.html