File tree 1 file changed +16
-11
lines changed
1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ <h1>YouTube Downloader</h1>
40
40
</ div >
41
41
42
42
< 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 >
44
44
< img src ="/img/youtube.png " alt ="">
45
45
</ div >
46
46
@@ -57,16 +57,21 @@ <h1>YouTube Downloader</h1>
57
57
</ form >
58
58
59
59
</ 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 >
70
75
71
76
72
77
< script src ="bundle.js "> </ script >
You can’t perform that action at this time.
0 commit comments