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

网络时间用的是哪里的表

发布时间: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

阅读全文

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

热点内容
添加网络共享打印机没有驱动 浏览:859
房间怎么设置网络接口 浏览:434
苹果美版怎么设置3g网络 浏览:147
无线网络f 浏览:651
网络专家证书有什么用 浏览:578
网络课程哪个课程贵 浏览:813
大富网络技术有限公司干什么的 浏览:886
路由器怎么跟网络电视连接 浏览:985
苹果1213的网络好卡啊 浏览:946
c类地址所在的网络地址怎么算 浏览:354
无线网络机顶盒排行榜 浏览:127
迷你路由器怎么设置无线桥接网络 浏览:502
有哪些开创了一个流派的网络小说 浏览:686
计算机网络package 浏览:94
还原与重新设置网络 浏览:154
p站为什么网络错误 浏览:730
计算机网络的扑扩结构 浏览:960
歌曲网络安全不烦恼舞蹈分解动作 浏览:732
施乐sc2020网络打印机设置 浏览:862
龙岩广电网络营业厅在哪里 浏览:577

友情链接