& lt; ! DOCTYPE html>
<meta charset="utf-8" & gt;
<meta HTTP - equiv="X - UA - Compatible" content="IE=edge" & gt;
<meta name="viewport" content="width=device - width, initial - scale=1.0" & gt;
Document
<style>
Div {
Width: 410 px;
height: 30px;
Border: 5 px solid # F00;
Padding: 15 px 10 px;
Background - color: # 0 f0;
margin: auto;
text-align: center;
}
</style>
<body>
<script>
Window. The onl oad=function () {
Var div=document. QuerySelector (' div ');
Var DayArray=[' on Sunday, Monday, Tuesday, Wednesday, ' ', 'on Thursday, Friday,' Saturday];
The function showTime () {
var now=new Date();
Var year=now. GetFullYear ();
Var month=now. GetMonth ();
Var date=now. GetDate ();
Var hour=now. GetHours ();
Var minutes=now. GetMinutes ();
Var seconds=now. GetSeconds ();
Var day=now. GetDay ();
If (seconds<10) {
Seconds='0' + seconds;
}
If (minutes<10) {
Minutes='0' + minutes;
}
Var time=year + + month 'years' +' month '+ date +', '+' '+' when '+ you + + hour' points' + seconds + 'seconds' +' '+ DayArray [day].
Div. InnerHTML='current system time:' + time;
SetTimeout (" showTime () ", 1000);
}
ShowTime ();
}
</script>