用途:
取得目前的日期時間

說明:
取得日期
new Date();

程式範例:
<script type ="text/javascript">
//宣告一個日期的變數,並取得現在日期。
var d = new Date();
//將現在日期顯示在頁面上
document.write("目前時間為:"+d);

</script>

測試結果:

 










 















其它文章

arrow
arrow

    PG Levin Li 發表在 痞客邦 留言(0) 人氣()