File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 " />
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6+ < meta http-equiv ="X-UA-Compatible " content ="ie=edge " />
7+ < link rel ="stylesheet " type ="text/css " href ="../styles.css " />
8+ < title > Your Local Time</ title >
9+ < style >
10+ body {
11+ background-color : # 212121 ;
12+ color : # fff ;
13+ }
14+ .center {
15+ display : flex;
16+ height : 100vh ;
17+ justify-content : center;
18+ align-items : center;
19+ flex-direction : column;
20+ }
21+ # clock {
22+ font-size : 40px ;
23+ background-color : orange;
24+ padding : 20px 50px ;
25+ margin-top : 10px ;
26+ border-radius : 10px ;
27+ }
28+ </ style >
29+ </ head >
30+ < body >
31+ < nav >
32+ < a href ="/ " aria-current ="page "> Home</ a >
33+ < a target ="_blank " href ="https://www.youtube.com/@chaiaurcode "
34+ > Youtube channel</ a
35+ >
36+ </ nav >
37+ < div class ="center ">
38+ < div id ="banner "> < span > Your local time</ span > </ div >
39+ < div id ="clock "> </ div >
40+ </ div >
41+ < script src ="script.js "> </ script >
42+ </ body >
43+ </ html >
Original file line number Diff line number Diff line change 1+ const clock = document . getElementById ( 'clock' ) ;
2+
3+ setInterval ( function ( ) {
4+
5+ let date = new Date ( ) ;
6+ clock . innerHTML = date . toLocaleTimeString ( ) ;
7+ } , 1000 )
You can’t perform that action at this time.
0 commit comments