- var d1 = new Date();
- var d2 = new Date();
- d2.setMonth(0);
- d2.setDate(1);
- var rq = d1-d2;
- var s1 = Math.ceil(rq/(24*60*60*1000));
- var s2 = Math.ceil(s1/7);
- alert("今天是本年第"+s1+"天,第"+s2+"周");//周日做为下周的开始计算
- //该片段来自于http://www.codesnippet.cn/detail/111220137953.html
来源: http://www.codesnippet.cn/detail/111220137953.html