宝塔服务器面板,一键全能部署及管理,送你10850元礼包,点我领取

Math.floor(Math.random()*10);//产生10以内的随机数

new Date(); //获取当前时间(字符串类型)

new Date().getTime(); //获取当前的毫秒数

new Date(1356334057000) ;//通过毫秒数创建时间

new Date().getMonth()+1; //获取月份,从0开始,所以要加上1

new Date().getFullYear(); //获取年份

new Date().getDay()+1;//获取当前是星期X,从0开始

new Date().getDate());//获取日

new Date().getHours()//获取小时

new Date().getMinutes()//获取分钟

new Date().getSeconds()//获取秒