HTML5 Code
<div id= "Time" >
<span id= "Hour" ></span>
<span id= "Data" ></span>
</div>
CSS Code
#time {
float:right;
Width:auto;
padding:0 50px;
border-left:2px solid Rgba (255,255,255,.3);
height:54px;
margin-top:13px;
margin-left:40px;
Color: #fff;
Cursor:default;
Text-align:center;
}
#hour {
display:block;
Width:auto;
font-size:22px;
height:34px;
line-height:34px;
Color: #fff;
Cursor:default;
}
#data {
display:block;
Width:auto;
font-size:10px;
height:20px;
line-height:20px;
Color: #fff;
Cursor:default;
}
jquery Code
/* Time counter/function p (s) {return S < 10?
' 0 ' + s:s;
function Nowtime () {var mydate = new Date (); var year = Mydate.getfullyear (); Get current year var month = Mydate.getmonth () +1; Gets the current month var date = Mydate.getdate (); Gets the current day var h = mydate.gethours (); Gets the current number of hours (0-23) var m = mydate.getminutes ();
Gets the current number of minutes (0-59) var s = mydate.getseconds ();
var data = year+ '-' + P (month) + "-" + p (date);
var hour = P (h) + ': ' + P (m);
$ ("#data"). HTML (data);
$ ("#hour"). HTML (hour);
} nowtime (); SetInterval (nowtime,1000);