惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
D
Docker
有赞技术团队
有赞技术团队
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
爱范儿
爱范儿
H
Help Net Security
美团技术团队
MyScale Blog
MyScale Blog
B
Blog RSS Feed
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
阮一峰的网络日志
阮一峰的网络日志
A
About on SuperTechFans
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
G
Google Developers Blog
月光博客
月光博客
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs

博客园 - allonkwok

http header as3 打开窗口类 select 中使用 case when 和 replace Tomcat Server 原理 SVN 安装配置快速入门 JS中常用的xpath特性 天极网软件频道的用JS实现的图片切换特效 div动态展开和关闭 DOM属性速查 div+css兼容性问题 asp常用函数 Flash使用正则进行注册验证 javascript 获取URL参数 仿163弹出层 GridView 介绍 转:GridView 72般绝技 [作者:清清月儿] Javascript Unicode 编码和反编码函数 提取文章内容的纯文本,并截取一定的字数 手机号码验证的JS代码(包含153、159)
javascrip动态时钟
allonkwok · 2007-05-14 · via 博客园 - allonkwok

function tick() {
var years, months, days, hours, minutes, seconds, ap;
var intHours, intMinutes, intSeconds;
var today;
today 
= new Date();
years 
= today.getYear() + "-";
months 
= (today.getMonth() + 1+ "-";
days 
= today.getDate() + " ";
intHours 
= today.getHours();
intMinutes 
= today.getMinutes();
intSeconds 
= today.getSeconds();
if (intHours == 0{
hours 
= "12:";
ap 
= "Midnight";
}
 else if (intHours < 12
hours 
= intHours+":";
ap 
= "A.M.";
}
 else if (intHours == 12{
hours 
= "12:";
ap 
= "Noon";
}
 else {
hours 
= intHours + ":";
ap 
= "P.M.";
}

if (intMinutes < 10{
minutes 
= "0"+intMinutes+":";
}
 else {
minutes 
= intMinutes+":";
}

if (intSeconds < 10{
seconds 
= "0"+intSeconds+" ";
}
 else {
seconds 
= intSeconds+" ";
}
 
timeString 
= years + months + days + hours + minutes + seconds + ap;
Clock.innerHTML 
= timeString;
//document.write(timeString);
window.setTimeout("tick();"1000);
}

window.onload 
= tick;

<span id="Clock"></span>