js获取当前日期为一年中的第几天

js获取当前日期为一年中的第几天

Math.ceil(( new Date() - new Date(new Date().getFullYear().toString()))/(24*60*60*1000))+1;

效果:


猜你喜欢

转载自blog.csdn.net/weixin_40687883/article/details/80909575