-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathproblem-3.js
More file actions
41 lines (37 loc) · 795 Bytes
/
problem-3.js
File metadata and controls
41 lines (37 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//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);