Judging by date, the date is the week ordinal of this month.

Source: Internet
Author: User
Tags current time date1
var Getmonthweek = function (A, B, c) {/ 
			* 
			a = d = Current date 
			b = 6-w = The current week is still a few days past (not today) 
			A + B and divided by 7 is the current month The week of the share 
			*/
			var date = new Date (A, parseint (b)-1, c), W = Date.getday (), d = date.getdate (); 
			Return Math.ceil ( 
			(d + 6-w)/7 
			); 
			};
			var Getyearweek = function (A, B, c) {/ 
			* 
			Date1 is the current date 
			Date2 is the first day of the year 
			D is the current date is the number of days 
			in D + The sum of the weeks of the first day of the current year divided by 7 is the week of the year 
			*/
			var date1 = new Date (A, parseint (b)-1, c), date2 = new Date (A, 0, 1), 
			d = Mat H.round ((date1.valueof ()-date2.valueof ())/86400000); 
			Return Math.ceil ( 
			(D + ((Date2.getday () + 1)-1)/7 
			); 
			/* today=new date ()//Get current time */
			var y = smonth[0];//year
			var m = smonth[1];//month
			var d = smonth[2];//day
			Aler T (Getmonthweek (Y, M, d));

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.