asp.net中頁面顯示當前系統(tǒng)時間附圖
更新時間:2013年12月27日 10:31:57 作者:
asp.net如何實現(xiàn)在頁面顯示當前系統(tǒng)時間,本文有個不錯的方法,大家可以嘗試操作下,在文章末尾有截圖
復制代碼 代碼如下:
<p class="time">當前系統(tǒng)時間:<script type="text/javascript">
today = new Date();
function initArray() {
this.length = initArray.arguments.length
for (var i = 0; i < this.length; i++)
this[i + 1] = initArray.arguments[i]
}
var d = new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
document.write(
"<font color=##000000 style='font-size:9pt;font-family: 宋體'> ",
(today.getYear()), "年",
today.getMonth() + 1, "月",
today.getDate(), "日",
d[today.getDay() + 1],
"</font>");
</script> <span id="liveclock"></span> <script type="text/javascript">
function www_helpor_net() {
var Digital = new Date()
var hours = Digital.getHours()
var minutes = Digital.getMinutes()
var seconds = Digital.getSeconds()
if (minutes <= 9)
minutes = "0" + minutes
if (seconds <= 9)
seconds = "0" + seconds
myclock = hours + ":" + minutes + ":" + seconds
if (document.layers) {
document.layers.liveclock.document.write(myclock)
document.layers.liveclock.document.close()
} else if (document.all)
liveclock.innerHTML = myclock
setTimeout("www_helpor_net()", 1000)
}
www_helpor_net();
</script> </p>
效果圖如下:

相關(guān)文章
自定義 DataList 顯示數(shù)據(jù)行數(shù)的方法
自定義 DataList 顯示數(shù)據(jù)行數(shù)的方法,需要的朋友可以參考一下2013-03-03為ASP.NET MVC及WebApi添加路由優(yōu)先級
這是一個對Asp.Net Mvc的一個很小的功能拓展,小項目可能不太需要這個功能,但有時候項目大了注冊的路由不生效時你應該要想到有可能是因為路由順序的原因,這時這個路由優(yōu)先級的功能有可能就會給你帶來便利。2015-10-10Asp.net之TextBox只允許輸入數(shù)字的方法總結(jié)
Asp.net之TextBox只允許輸入數(shù)字的方法總結(jié),需要的朋友可以參考一下2013-02-02ASP.NET Core中如何利用多種方式給Action傳參
這篇文章主要給大家介紹了關(guān)于ASP.NET Core中如何利用多種方式給Action傳參的相關(guān)資料,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-12-12