简体   繁体   中英

Javascript: How to get month from week number and year?

I am trying to get month from given week number and year. Can someone help?

Example: Week - 48 Year - 2023 Output - 11

This will extrapolate the month by getting the total milliseconds from the number of weeks.

 //Example: Week - 48 Year - 2023 Output - 11 let weeknumber = 48 let month = new Date(1000 * 60 * 60 * 24 * 7 * weeknumber).getMonth() console.log(month)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM