当前位置:网站首页>JS gets the first month of the year, the second month to the last month, and the first day to the last day

JS gets the first month of the year, the second month to the last month, and the first day to the last day

2022-06-13 08:33:00 BUG_ Jia

const start = new Date(new Date().getFullYear(), 1);
// Get January of the current year 1 Japan 
const end = new Date(new Date().getFullYear(), 2);
// Get February of the current year 
end.setTime(end.getTime() - 3600 * 1000 * 24)
// obtain end Last day of the month 
/*  In brackets 1,2  Represents the month you need to get */

原网站

版权声明
本文为[BUG_ Jia]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202270541410620.html