js get full day code example
Example 1: get day js
switch (new Date().getDay()) {
case 0:
day = "Sunday";
break;
case 1:
day = "Monday";
break;
case 2:
day = "Tuesday";
break;
case 3:
day = "Wednesday";
break;
case 4:
day = "Thursday";
break;
case 5:
day = "Friday";
break;
case 6:
day = "Saturday";
}
Example 2: javascript get date
let date = new Date();
let string = date.toString();
Example 3: javascript get current day of month
new Date().getDate();
Example 4: js get day month year
const d = new Date();
d.getMonth() + 1;
d.getDate();
d.getFullYear();