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

推荐订阅源

J
Java Code Geeks
G
Google Developers Blog
有赞技术团队
有赞技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客
博客园 - 聂微东
V
Visual Studio Blog
博客园_首页
D
DataBreaches.Net
腾讯CDC
I
InfoQ
F
Fortinet All Blogs
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
云风的 BLOG
云风的 BLOG
月光博客
月光博客
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
C
Check Point Blog

博客园 - 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>