Answers for "js get day name"

7

how to get the day name from date in javascript

var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
var d = new Date(dateString);
var dayName = days[d.getDay()];
Posted by: Guest on May-20-2021
17

Javascript get month name

var  months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var d = new Date();
var monthName=months[d.getMonth()]; // "July" (or current month)
Posted by: Guest on July-31-2019
3

js get date day month year

var dateObj = new Date();
var month = dateObj.getUTCMonth() + 1; //months from 1-12
var day = dateObj.getUTCDate();
var year = dateObj.getUTCFullYear();

newdate = year + "/" + month + "/" + day;
Posted by: Guest on November-25-2020
2

get name of day javascript

var today = new Date();

console.log(today.getDay()); // sunday = 0, monday = 1, etc..
Posted by: Guest on August-22-2020
0

get day name from date javascript

const dayIndex = new Date().getDay();
const getDayName = (dayIndex) =>{
	const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
	return days[dayIndex];
}
const dayName = getDayName(dayIndex)
Posted by: Guest on September-07-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language