Skip to content

Commit 6f7de20

Browse files
try new
1 parent 156dfd2 commit 6f7de20

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

index.html

+16-11
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h1>YouTube Downloader</h1>
4040
</div>
4141

4242
<div class="container">
43-
<p>supported platforms as of: </p><div id="date"></div>
43+
<p>supported platforms as of: </p><span id="datetime-display"></span>
4444
<img src="/img/youtube.png" alt="">
4545
</div>
4646

@@ -57,16 +57,21 @@ <h1>YouTube Downloader</h1>
5757
</form>
5858

5959
</div>
60-
<script>
61-
// Get the current date
62-
const today = new Date();
63-
64-
// Format the date to YYYY-MM-DD
65-
const formattedDate = today.toISOString().split('T')[0];
66-
67-
// Set the value of the date input to the current date
68-
document.getElementById('date').value = formattedDate;
69-
</script>
60+
61+
<script>
62+
// Function to display current date and time
63+
const datetimeDisplayElement = document.getElementById("datetime-display");
64+
65+
// Create a new Date object
66+
const currentDateTime = new Date();
67+
68+
// Extract the date and time components
69+
const date = currentDateTime.toDateString();
70+
const time = currentDateTime.toLocaleTimeString();
71+
72+
// Display the date and time in the span element
73+
datetimeDisplayElement.textContent = `Current Date: ${date} | Current Time: ${time}`;
74+
</script>
7075

7176

7277
<script src="bundle.js"></script>

0 commit comments

Comments
 (0)