标签:class blog java ext get javascript
<span id="localtime"><span> <script type="text/javascript"> function showLocalTime(OID) { window.setTimeout(function(){ var today = new Date(), arr = new Array(‘日‘, ‘一‘, ‘二‘, ‘三‘, ‘四‘, ‘五‘, ‘六‘), yy = today.getYear(), mm = today.getMonth()+1, dd = today.getDate(), hh = today.getHours(), ii = today.getMinutes(), ss = today.getSeconds(), ww = today.getDay(); yy = yy < 1900 ? yy + 1900 : yy; mm = mm < 10 ? ‘0‘ + mm : mm; dd = dd < 10 ? ‘0‘ + dd : dd; hh = hh < 10 ? ‘0‘ + hh : hh; ii = ii < 10 ? ‘0‘ + ii : ii; ss = ss < 10 ? ‘0‘ + ss : ss; document.getElementById(OID).innerHTML = yy + ‘-‘ + mm + ‘-‘ + dd + ‘ ‘ + hh+‘:‘+ii+‘:‘+ss + ‘ 星期‘ + arr[ww]; showLocalTime(OID); }, 1000); } showLocalTime(‘localtime‘);
JavaScript 时间显示,布布扣,bubuko.com
标签:class blog java ext get javascript
原文地址:http://www.cnblogs.com/lifelog/p/3810385.html