亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

利用JS獲取當前系統(tǒng)時間

オリジナル 2019-04-27 18:08:12 288
サマリー:利用js的date函數(shù)可以獲取當前電腦時間,并可以分不同的時間種類獲取單個時間值<!DOCTYPE html><html><head>    <meta charset="UTF-8">    <title>Date日期操作</title></head>&

利用js的date函數(shù)可以獲取當前電腦時間,并可以分不同的時間種類獲取單個時間值


<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8">
   <title>Date日期操作</title>
</head>
<body>
<script>
   let time = new Date();
   document.write(time+'<br>')

   Year = time.getFullYear()//年
   Month = time.getMonth()+1//月0代表1月
   Day = time.getDate()//日

   Hours = time.getHours()//時
   Minutes = time.getMinutes()//分
   Seconds = time.getSeconds()//秒

   document.write('現(xiàn)在的時間是'+ Year+'年'+Month+'月'+Day+'日 '+Hours+':'+Minutes+':'+Seconds)


</script>

</body>
</html>

添削の先生:天蓬老師添削時間:2019-04-28 09:10:43
先生のまとめ:Year = time.getFullYear()//年 Month = time.getMonth()+1//月0代表1月 Day = time.getDate()//日 Hours = time.getHours()//時 Minutes = time.getMinutes()//分 Seconds = time.getSeconds()//秒 你這樣寫會創(chuàng)建

手記を発表する

人気のある見出し語