Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get first and last date of month in javascript

const firstDay = new Date(now.getFullYear(), now.getMonth(), 1);
console.log(firstDay); // Sat Oct 01 2022 ...

const lastDay = new Date(now.getFullYear(), now.getMonth() + 1, 0);
console.log(lastDay); // Mon Oct 31 2022 ...
 
PREVIOUS NEXT
Tagged: #date #month #javascript
ADD COMMENT
Topic
Name
5+2 =