2010年3月12日

          JavaScript Date 對象參考手冊

          Date 對象

          Date 對象用于處理日期和時間。

          創建 Date 對象的語法:

          var myDate=new Date()

          注釋:Date 對象會自動把當前日期和時間保存為其初始值。


          Date 對象屬性

          FF: Firefox, IE: Internet Explorer

              (1)    constructor 屬性返回對創建此對象的 Date 函數的引用。  

                      語法

                  object.constructor

                          

          實例

          在本例中,我們將展示如何使用 constructor 屬性:

           1<script type="text/javascript">
           2
           3var test=new Date();
           4
           5if (test.constructor==Array)
           6{
           7document.write("This is an Array");
           8}

           9if (test.constructor==Boolean)
          10{
          11document.write("This is a Boolean");
          12}

          13if (test.constructor==Date)
          14{
          15document.write("This is a Date");
          16}

          17if (test.constructor==String)
          18{
          19document.write("This is a String");
          20}

          21
          22</script>

              輸出:

              This is a Date


              
              (2)

          posted @ 2010-03-12 17:27 housen 閱讀(88) | 評論 (0)編輯 收藏

          <2010年3月>
          28123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910

          導航

          統計

          常用鏈接

          留言簿

          隨筆檔案

          搜索

          最新評論

          主站蜘蛛池模板: 无极县| 上虞市| 加查县| 英超| 永安市| 宁德市| 佛学| 天祝| 林西县| 邓州市| 永昌县| 迭部县| 宁晋县| 洛浦县| 方山县| 平陆县| 石景山区| 荃湾区| 永登县| 马山县| 南平市| 陵川县| 玉溪市| 梁山县| 分宜县| 台东市| 利津县| 邻水| 鹿泉市| 栖霞市| 迭部县| 即墨市| 民权县| 武胜县| 固原市| 闻喜县| 渑池县| 红河县| 海口市| 隆德县| 独山县|