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

網路時間用的是哪裡的表

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

閱讀全文

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

熱點內容
特斯拉設置車載網路熱點 瀏覽:900
列印機屬於計算機網路通信設備 瀏覽:374
汽車網路連接啟動 瀏覽:336
共享實驗室網路畫板 瀏覽:948
kalilinux如何看自己網路 瀏覽:978
陝西廣電網路有多少個分公司 瀏覽:173
台式電腦怎麼設置網路分機 瀏覽:53
現在主流的網路設備有哪些 瀏覽:567
紅米卡2無法訪問移動網路 瀏覽:98
庫車市網路密碼 瀏覽:906
網路營銷扶貧助農 瀏覽:535
用網路營銷平台賣寺廟東西 瀏覽:145
捷豹網路是哪個平台 瀏覽:455
網路小說在哪個平台可以看 瀏覽:209
剛換電腦系統怎麼搞無線網路 瀏覽:306
50兆電視能帶多少網路盒 瀏覽:908
強化底線思維網路安全 瀏覽:759
網路視頻會議軟體租用 瀏覽:450
手機瀏覽器手機網路降速2g 瀏覽:267
網路營銷平台多少錢 瀏覽:870

友情鏈接