在状态栏中显示当前系统时间
2010-09-10 14:32
323 查看
<script language="javascript">
<!--
var timerID =null ;
var timerRunning = false;
function stopclock()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning =false;
}
function showtime()
{
var now =new Date();
var hours =now.getHours();
var minutes = now.getMinutes();
var seconds =now.getSeconds();
var timeValue =""+((hours >12)? hours -12 : hours);
timeValue +=((minutes <10)? " :0" : " : ") + minutes;
timeValue +=((seconds <10)? " :0" : " : ") +seconds;
timeValue +=(hours >= 12) ? " P.M " : " A.M ";
window.status = timeValue ;
timerID = setTimeout ("showtime ()" ,1000) ;
timerRunning = true ;
}
function startclock ()
{
stopclock();
showtime();
}
// - ->
</script>
<!--
var timerID =null ;
var timerRunning = false;
function stopclock()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning =false;
}
function showtime()
{
var now =new Date();
var hours =now.getHours();
var minutes = now.getMinutes();
var seconds =now.getSeconds();
var timeValue =""+((hours >12)? hours -12 : hours);
timeValue +=((minutes <10)? " :0" : " : ") + minutes;
timeValue +=((seconds <10)? " :0" : " : ") +seconds;
timeValue +=(hours >= 12) ? " P.M " : " A.M ";
window.status = timeValue ;
timerID = setTimeout ("showtime ()" ,1000) ;
timerRunning = true ;
}
function startclock ()
{
stopclock();
showtime();
}
// - ->
</script>
相关文章推荐
- MFC状态栏的编程(以显示系统当前时间为例)
- JS(截取字符串,显示当前系统时间yyyy-MM-dd,从文本框得到的数值计算)
- 示例:Servlet显示当前系统时间(时间格式化)
- WPF中添加个简单的显示当前系统时间的示例
- WPF 显示当前系统时间
- 响应事件示例:同时在按钮上和状态栏中显示当前时间,如果单击按钮,会显示信息框
- javascript 显示当前系统时间
- 如何在网页中动态显示当前的系统日期和时间?
- JS(截取字符串,显示当前系统时间yyyy-MM-dd,从文本框得到的数值计算)
- JS使用Date对象实时显示当前系统时间简单示例
- 使用js显示当前系统时间
- jsp页面实时显示当前系统时间方法
- 使用线程 在shell上同步动态显示当前系统时间
- 显示当前时间的函数,当初是为了里面的check函数,我还以为是系统自带的(目前没找到奥这个函数,但是以前学过,不重要就先不看了)
- 在页面显示系统当前时间
- 显示系统当前时间的汇编程序
- my97datepicker控件 JSP页面打开默认显示系统当前时间
- c++实现显示系统当前时间
- (转)VC++之系统控制之设置显示系统当前时间
- 如何在TextBox控件中显示系统当前时间?包括:年、月、日、时、分