导航:首页 > 网络营销 > 网络时间用的是哪里的表

网络时间用的是哪里的表

发布时间:2023-02-27 03:40:48

如何用JS命令制作一个网络时钟,时间取自网络标准时钟的时间(不是取自本地电脑的时间)。

<div id="d"></div>
<canvas id="clock" width="400" height="400"></canvas>
<script type="text/javascript">
var time = new Date();
var h = time.getHours(); //时
var m = time.getMinutes(); //分
var s = time.getSeconds(); //秒
h=h>12?(h-12)*5+parseInt(m/12):h*5+parseInt(m/12); //时针 初始位置
//=====================================
var x=200,y=200,sAngle=0; //x y 原点 秒针角度变量

function draw(){
var c=document.getElementById("clock");
var ctx=c.getContext("2d"); //获取绘图对象
ctx.clearRect(0,0,c.width,c.height); //清除上次绘制的图形
s++;//秒针

ctx.fillStyle = '#fff' //填充白色背景色
ctx.fillRect(0,0,c.width,c.height); //设置画布区域

//填充圆点,在画布中心(200,200)绘制一个半径10px的圆形
ctx.beginPath();
ctx.arc(x,y,10,0,Math.PI*2,true);
ctx.fill();
ctx.closePath();

//填充版权文字
ctx.fillStyle="#ccc";
ctx.font = "12pt Arial";
ctx.fillText(" beyond",150,250);
//调用日期并填充到画布中
ctx.fillStyle="#666";
ctx.font = "14pt Verdana";
ctx.fillText(time.getMonth()+1+"-"+time.getDate(),183,170);

ctx.save(); //保存当前绘图状态

// 时间刻度
for(var i=0;i<12;i++){
var angle=(Math.PI*2)/12;
ctx.beginPath();//开始绘制
ctx.font="12px Arial";
if(i==0||i==3||i==6||i==9){
ctx.fillStyle="red";
radius=4;
}else{
ctx.fillStyle="blue";
radius=3;
}

ctx.arc(x,y-100,radius,0,Math.PI*2,true); //画圆
ctx.fill(); //填充路径
trans(ctx,x,y,angle); //刻度分布
}
ctx.restore(); //恢复上次保存的绘图状态

sAngle=(Math.PI*2)/60*s; //秒度
//时针转动
ctx.save();
ctx.strokeStyle="red";
ctx.lineWidth=3;
trans(ctx,x,y,(Math.PI*2)/60*h);
pointer(ctx,x,y,y-40);
ctx.restore();

//分针转动
ctx.save();
ctx.strokeStyle="blue";
ctx.lineWidth=2;
trans(ctx,x,y,(Math.PI*2)/60*m);
pointer(ctx,x,y,y-68);
ctx.restore();

//秒针转动
ctx.save();
ctx.strokeStyle="#000";
trans(ctx,x,y,sAngle);
pointer(ctx,x,y,y-80);
ctx.restore();

//数据整理
if(s%60==0){
sAngle=0,s=0,m++;
if(m%12==0){ //每十二分 时针旋转一次
if(m!=0)h++;
if(m%60==0)m=0;
}
if(h%60==0)h=0;
}
}

//绘制指针
function pointer(ctx,x,y,z){
ctx.beginPath();
ctx.moveTo(x,y);
ctx.lineTo(x,z);
ctx.stroke();
ctx.fill();
}

//据坐标旋转
function trans(ctx,x,y,angle){
ctx.transform(Math.cos(angle), Math.sin(angle),
-Math.sin(angle), Math.cos(angle),
x*(1-Math.cos(angle)) + x*Math.sin(angle),
y*(1-Math.cos(angle)) - y*Math.sin(angle))
}

setInterval("draw()",1000);
</script>
</div>

㈡ internet网络高峰时间段是什么时间

CNNIC第17次互联网报告 网民达1.11亿

本次调查结果与上年同期相比,18~22点上网人数增加了8个百分点,上网高峰日趋凸显,20点是当日上网顶峰,61.1%的网民在这一时间上网,21点以后上网人数急剧减少。

根据好耶联合艾瑞市场咨询(iResearch)发布的《2004年好耶网络广告服务报告》的数据显示:2004年中国网民每天上网高峰时间段是19:00-21:00,凌晨到早晨7点间上网的网民比例较低。

这是2004年的,最近的找不到。。。

http://www.hexun.com/Images/08/82/88247.gif

阅读全文

与网络时间用的是哪里的表相关的资料

热点内容
学校无线网络规划方案 浏览:576
网络安全法师徒四人宣传片 浏览:221
怎么学好思科网络工程 浏览:13
苹果手机开着移动网络接不到微信 浏览:659
邯郸中国移动网络维修电话 浏览:792
v20没有高级选项网络与无线 浏览:214
4k电视网络怎么设置 浏览:132
网络副业应用软件排名 浏览:855
网络信号118是什么意思 浏览:381
网络精英有什么好处 浏览:190
哈罗单车无网络连接状态如何使用 浏览:488
桥接无线网络设备 浏览:719
让手机移动网络快上十倍的方法 浏览:690
社区网络员实操考试考什么 浏览:123
网络连接电脑显示断网 浏览:999
双无线网络叠加 浏览:132
爱口袋手机网络连接异常怎么回事 浏览:727
电脑主版cmos哪个是网络设置 浏览:409
通话中有网络是开哪个 浏览:268
锐捷网络登陆账号是什么 浏览:252

友情链接