久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      javascript算出活了多少天

      javascript算出活了多少天的方法:首先定義自己的生日;然后通過“parseInt((today.getTime()-birthday.getTime())/(1000*3600*24));”方法計算活了多少天即可。

      javascript算出活了多少天

      本文操作環(huán)境:windows7系統(tǒng)、javascript1.8.5版,DELL G3電腦

      javascript算出活了多少天的方法

      計算你從出生到今天活了多少天,今年多少歲

      代碼如下:

      <script type="text/javascript">               var birthday=new Date("1996/06/21");//定義自己的生日      var today=new Date();   //getTime() 返回從 1970 年 1 月 1 日至今的毫秒數(shù)。   //1秒=1000毫秒  3600=1小時*1分鐘   24=24小時     var time=parseInt((today.getTime()-birthday.getTime())/(1000*3600*24));     var year=Math.round(time/365);//round() 方法可把一個數(shù)字舍入為最接近的整數(shù)。       document.write("從出生到今天活了"+time+"天<br />");        document.write("今年"+year+"歲"); </script >

      推薦學習:《javascript高級教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號