zoukankan      html  css  js  c++  java
  • JS时间的不同写法

     <script type="text/javascript">
            var thedate = new Date(2012, 3, 7, 12, 11, 12,222);
            alert(thedate.toLocaleString());//时间将变成本地的字符串表示
            alert(thedate.getMilliseconds());//获取毫秒

          
          
            var thedate = new Date('2012, March, 7,12:11:22');
            alert(thedate.toLocaleString()); //时间将变成本地的字符串表示
            alert(thedate.getMilliseconds());//获取毫秒(没有值为0)
          alert(thedate.getYear()); //建议使用GetFullYear获取年,获取年                
        </script>

  • 相关阅读:
    链表的常用操作
    android简易论坛的制作
    Bmob后端云的使用
    马哥第九周
    马哥第八周
    马哥第七周
    马哥第六周
    马哥第五周
    马哥第四周
    马哥第三周
  • 原文地址:https://www.cnblogs.com/duanlinlin/p/3010839.html
Copyright © 2011-2022 走看看