導航:首頁 > 網路營銷 > 網路時間用的是哪裡的表

網路時間用的是哪裡的表

發布時間: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

閱讀全文

與網路時間用的是哪裡的表相關的資料

熱點內容
手機開機無線網路卻連不上 瀏覽:698
網路信號強連接速度慢怎麼回事 瀏覽:619
網路電視怎麼調出電視信號 瀏覽:357
網路五項是什麼 瀏覽:779
網路用語卡bug如何回復 瀏覽:417
創維電視怎麼安裝網路電視 瀏覽:868
電腦移動ip無訪問網路許可權 瀏覽:452
曲阜網路教育培訓哪裡好 瀏覽:116
蘋果手機為什麼有信號但是無網路 瀏覽:703
有哪些新技術在影響網路輿論生態 瀏覽:578
南寧網路貸款哪個門檻低 瀏覽:951
公開無線網路 瀏覽:646
無線網路改名字怎麼設置 瀏覽:506
上網不斷線深圳哪個網路最好 瀏覽:474
什麼叫開關接網路 瀏覽:940
筆記本網路限速設置 瀏覽:476
蘋果手機更新後網路延時 瀏覽:346
手機網路已連接不可上網怎麼處理 瀏覽:920
網路未顯示異常但是不能上網 瀏覽:814
電信專線網路怎麼連接路由器 瀏覽:168

友情鏈接