javascript current date
//parameters will specify date you put to input
// var date = new Date(year, month, day, hours, minutes, seconds, milliseconds);
// show current month
const localDate = new Date();
const months = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
];
let currentMonth = months[localDate.getMonth()];
console.log(currentMonth);
// show current date
const localDate = new Date();
const currentDate = localDate.getDate();
console.log(currentDate);
// show current day
const localDate = new Date();
const days = [
"Sunday",
"Monday ",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
];
const currentDay = days[localDate.getDay()];
console.log(currentDay);// new Date parameters in javascript
new Date(year, month, date, hours, minutes, seconds, ms)let today = new Date().toLocaleDateString()
console.log(today)var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = date+' '+time;
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();