-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
18 lines (12 loc) · 672 Bytes
/
Copy pathapp.js
File metadata and controls
18 lines (12 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const getDay = document.getElementById("currentDay");
const getTime = document.getElementById("currentTime")
const currentDate = new Date();
// use an array to display day of the week
const daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
// specify day of the week to be displayed
const currentDay = daysOfWeek[currentDate.getDay()];
const currentTime = currentDate.getTime();
// to display display current day on the page
getDay.innerHTML = `<strong>Current Day :</strong> ${currentDay}`;
// to display display current time on the page
getTime.innerHTML = `<strong>Current Time in millisecond :</strong> ${currentTime}`;