-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (22 loc) · 749 Bytes
/
Copy pathscript.js
File metadata and controls
24 lines (22 loc) · 749 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
// Placeholder for future JavaScript functionality
document.addEventListener('DOMContentLoaded', () => {
console.log("Page loaded");
});
document.getElementById('year').textContent = new Date().getFullYear();
function updateDateTime() {
const now = new Date();
const options = {
year: 'numeric',
month: 'long',
day: 'numeric',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: true
};
document.getElementById('dateTime').textContent = now.toLocaleString('en-US', options);
}
// Update the date and time every second
setInterval(updateDateTime, 1000);
// Initial call to display the date and time immediately
updateDateTime();