<script>
Element.prototype.myDate = function(){
var date = new Date();
year=date.getFullYear(),
month=date.getMonth()+1,
day=date.getDate(),
hour=date.getHours(),
minutes=date.getMinutes(),
seconds=date.getSeconds();
console.log("现在是"+year+"年"+month+"月"+day+"日"+hour+"时"+Mi+"分"+se+"秒")
}
</script>
js---------------------------封装函数,打印当前是何年何月何日何时,几分几秒
最新推荐文章于 2022-07-13 15:47:53 发布