爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
各地时间显示
各地时间显示
日期:2014-05-18 浏览次数:20192 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 第一步:把如下代码加入<body>区域中 <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var timerID ; function tzone(tz, os, ds, cl) { this.ct = new Date(0) ; // datetime this.tz = tz ; // code this.os = os ; // GMT offset this.ds = ds ; // has daylight savings this.cl = cl ; // font color } function UpdateClocks() { var ct = new Array( new tzone('SFO: ', -8, 1, 'lime'), new tzone('TYO: ', +9, 0, 'violet'), new tzone('HKG: ', +8, 0, 'cyan'), new tzone('BKK: ', +7, 0, 'yellow'), new tzone('NYC: ', -5, 1, '#FFAA00'), new tzone('LON: ', 0, 1, 'silver'), new tzone('SVO: ', +3, 0, 'pink'), new tzone('KTM: ', +5.75, 0, 'red') ) ; var dt = new Date() ; // [GMT] time according to machine clock var startDST = new Date(dt.getFullYear(), 3, 1) ; while (startDST.getDay() != 0) startDST.setDate(startDST.getDate() + 1) ; var endDST = new Date(dt.getFullYear(), 9, 31) ; while (endDST.getDay() != 0) endDST.setDate(endDST.getDate() - 1) ; var ds_active ; // DS currently active if (startDST < dt && dt < endDST) ds_active = 1 ; else ds_active = 0 ; // Adjust each clock offset if that clock has DS and in DS. for(n=0 ; n<ct.length ; n++) if (ct[n].ds == 1 && ds_active == 1) ct[n].os++ ; // compensate time zones gmdt = new Date() ; for (n=0 ; n<ct.length ; n++) ct[n].ct = new Date(gmdt.getTime() + ct[n].os * 3600 * 1000) ; document.all.Clock0.innerHTML = '<font color="' + ct[0].cl + '">' + ct[0].tz + ClockString(ct[0].ct) + '</font>' ; document.all.Clock1.innerHTML = '<font color="' + ct[1].cl + '">' + ct[1].tz + ClockString(ct[1].ct) + '</font>' ; document.all.Clock2.innerHTML = '<font color="' + ct[2].cl + '">' + ct[2].tz + ClockString(ct[2].ct) + '</font>' ; document.all.Clock3.innerHTML = '<font color="' + ct[3].cl + '">' + ct[3].tz + ClockString(ct[3].ct) + '</font>' ; document.all.Clock4.innerHTML = '<font color="' + ct[4].cl + '">' + ct[4].tz + ClockString(ct[4].ct) + '</font>' ; document.all.Clock5.innerHTML = '<font color="' + ct[5].cl + '">' + ct[5].tz + ClockString(ct[5].ct) + '</font>' ; document.all.Clock6.innerHTML = '<font color="' + ct[6].cl + '">' + ct[6].tz + ClockString(ct[6].ct) + '</font>' ; document.all.Clock7.innerHTML = '<font color="' + ct[7].cl + '">' + ct[7].tz + ClockString(ct[7].ct) + '</font>' ; timerID = window.setTimeout("UpdateClocks()", 1001) ; } function ClockString(dt) { var stemp, ampm ; var dt_year = dt.getUTCFullYear() ; var dt_month = dt.getUTCMonth() + 1 ; var dt_day = dt.getUTCDate() ; var dt_hour = dt.getUTCHours() ; var dt_minute = dt.getUTCMinutes() ; var dt_second = dt.getUTCSeconds() ; dt_year = dt_year.toString() ; if (0 <= dt_hour && dt_hour < 12) { ampm = 'AM' ; if (dt_hour == 0) dt_hour = 12 ; } else { ampm = 'PM' ; dt_hour = dt_hour - 12 ; if (dt_hour == 0) dt_hour = 12 ; } if (dt_minute < 10) dt_minute = '0' + dt_minute ; if (dt_second < 10) dt_second = '0' + dt_second ; stemp = dt_month + '/' + dt_day + '/' + dt_year.substr(2,2) ; stemp = stemp + ' ' + dt_hour + ":" + dt_minute + ":" + dt_second + ' ' + ampm ; return stemp ; } // End --> </script> <table border="0" cellspacing="0" width="100%"> <tr bgcolor="#000000" style="font-family: Verdana, Tahoma, Arial; font-size: x-small"> <td ID="Clock0" width="25%" > </td> <td ID="Clock1" width="25%" > </td> <td ID="Clock2" width="25%" > </td> <td ID="Clock3" width="25%" > </td> </tr> <tr bgcolor="#000000" styl
上一篇:狡猾的按钮特效
下一篇:日期的自由选择
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
锐迪科将以9.25美元/ADS价钱出售835万份ADS
阿里物流搭上邮政:京东,我们在终点等你!
2019双12阿里云老用户怎么参加拼团活动 老用户拼团方法
iPhone 6 Plus要召回是谣言
完美入股盛大:一桩各怀心事的交易
虚拟运营商前路迷茫 业界建议发力车联网
喜大普奔:2016年国内乘客有望在飞机上使用手机
苹果6月20日发布iPhone5S 触摸屏概念股生动
屌丝程序猿发家机会来了 用大数据来做生意!
推荐阅读
更多>
亚马逊落户上海自贸区:美国货直邮中国
NEC拟出售移动效劳子公司NEC Mobile
国美在线叫板京东:李俊涛底气在哪?
中国移动承诺再降4G资费 网络漫游至50个国家
空气污染器市场乱象丛生 选购需慎重
电信业营改增今起实施 运营商短期利润骤降
中电信率先推移动转售业务 中下旬批量上市
历史惊人相似:如今的库克 曾经的鲍尔默
亚马逊第三方平台真的卖盗版书?
宽带中国战略明确 运营商建设成本超6000亿
杨元庆去年总薪酬1.33亿元
诺基亚仍是第二大手机商:功用机有利可图
看蜗牛如何放水养鱼,盘活生态系统
高通反垄断案下月有望落定
同为70前后人,马云为什么总是像外星人那么瘦
英特尔承认,联想最新K系列智能手机放弃英特尔处理器
苹果优势逐渐丧失 传即将推出廉价iPhone
腾讯微信昨晚再现大规模故障 多地受到影响
魅族黄章惹怒芙蓉姐姐 将跨界推女神手机
谷歌董事长成花花公子:情史足以媲美涂鸦