Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript first and last day of the month

var date = new Date(), y = date.getFullYear(), m = date.getMonth();
var firstDay = new Date(y, m, 1);
var lastDay = new Date(y, m + 1, 0);
Comment

js get first and last day of previous month

var d = new Date();
d.setDate(0); //sets d to the last day of the previous month
d.setDate(1); //sets d the the first day of that month
d.setHours(0,0,0,0); //sets d time to midnight

//d now equals the first day of the month before today      
Comment

PREVIOUS NEXT
Code Example
Javascript :: js outputting data 
Javascript :: emitting event on socket.io using async await 
Javascript :: javascript merge two array with spread operator 
Javascript :: delete node from linked list 
Javascript :: convert string to array javascript 
Javascript :: parsing json object in java 
Javascript :: what is $ in jquery 
Javascript :: Check propery of an objects array 
Javascript :: byte number to array js 
Javascript :: mongoose select 
Javascript :: javascript goto page 
Javascript :: selected dropdown value 
Javascript :: js array last element 
Javascript :: js display image from external url 
Javascript :: node js version 14 
Javascript :: export aab bundle react native android 
Javascript :: how to convert div to image in jquery 
Javascript :: how to see my timezone using js 
Javascript :: JavaScript Element fade out 
Javascript :: express req body 
Javascript :: set array length js 
Javascript :: play audio in react 
Javascript :: react build size 
Javascript :: sum array without loop javascript 
Javascript :: countdown js 
Javascript :: switch for comparing greater value 
Javascript :: How to iterate elements in an object 
Javascript :: how to use cookies in react class component 
Javascript :: get a header from postman repsonse 
Javascript :: jquery get padding top without px 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =