⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datetime.txt

📁 java脚本即用特效源码从入门到精通帮你渡过难关
💻 TXT
字号:
<!-- 安装 状态栏显示日期时间 的步骤:

   1.  把数据复制到你的Html档案的Head标记下
   2.  把数据复制到你的Html档案的Body标记下   -->

<!-- 步骤一: 把以下数据复制到你的Html档案的Head标记下  -->
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
<!-- Activate Cloaking Device

// Global variables for timer.
var timerID = null;

var timerRunning = false;

// Called by both onLoad in BODY tag, and Resume button.
function startclock () 
{

// Make sure the clock is stopped
stopclock();
time();
}
// Kills clock.
function stopclock ()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function time ()
{
var now = new Date();
var yr = now.getYear();
var mName = now.getMonth() + 1;
var dName = now.getDay() + 1;

var dayNr = ((now.getDate()<10) ? "0" : "")+ now.getDate();
var ampm = (now.getHours() >= 12) ? " 下午" : " 上午"
var hours = now.getHours();
hours = ((hours > 12) ? hours - 12 : hours);

var minutes = ((now.getMinutes() < 10) ? "时0" : "时") + now.getMinutes();

var seconds = ((now.getSeconds() < 10) ? "分0" : "分") + now.getSeconds();

if(dName==1) Day = "星期天";
if(dName==2) Day = "星期一";
if(dName==3) Day = "星期二";
if(dName==4) Day = "星期三";
if(dName==5) Day = "星期四";
if(dName==6) Day = "星期五";
if(dName==7) Day = "星期六";

if(mName==1) Month="1月";
if(mName==2) Month="2月";
if(mName==3) Month="3月";
if(mName==4) Month="4月";
if(mName==5) Month="5月";
if(mName==6) Month="6月";
if(mName==7) Month="7月";
if(mName==8) Month="8月";
if(mName==9) Month="9月";
if(mName==10) Month="10月";
if(mName==11) Month="11月";
if(mName==12) Month="12月";


// String to display current date.

var DayDateTime=(" "+ yr + "年"+  Month + dayNr + "日" + Day + ampm + hours + minutes + seconds + "秒" );

// Displays Day-Date-Time on the staus bar.
window.status=DayDateTime;
timerID = setTimeout("time()",1000);
timerRunning = true;
}
// Stops clock and clears status bar.
function clearStatus()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
window.status=" "; 
}


// Used for View Source
function WinOpen() 
{
alert('\nPage will load to full screen.\n\nUse View/Document Source from menu bar to view source.\n\nClose new window to return to this page. ');
window.open("js-statc.htm","DisplayWindow","menubar=yes,status=yes");
window.open("js-statc.htm","DisplayWindow","menubar=yes,status=yes"); // double call for Macs
}
// Deactivate Cloaking -->
</script>
</HEAD>

<!-- 步骤二: 把以下数据复制到你的Html档案的Body标记下  -->
<BODY>
<p align="center"><font color="#FF0000" size="5">状 态 栏 日 期 与 时 间</font></p>

    <div align="center"><center><table border="0" width="300">
        <tr>
            <td align="center"><font size="3"><b><input
            type="button" value="停止" onclick="stopclock()"> </b></font></td>
            <td align="center"><font size="3"><b><input
            type="button" value="开始" onclick="startclock()"> </b></font></td>
            <td align="center"><font size="3"><b><input
            type="button" value="清除" onclick="clearStatus()">
            </b></font></td>
        </tr>
    </table>
    </center></div>
</BODY>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -