zoukankan      html  css  js  c++  java
  • Javascript日期函数

    var currentDate = new Date();
    
     outStr=outStr+"getTime:"+currentDate.getTime()+"<br/>";//获取当前时间(从1970.1.1开始的毫秒数)
     
     outStr=outStr+"getFullYear:"+currentDate.getFullYear()+"<br/>";//获取完整的年份(4位,1970-????)
     
     outStr=outStr+"getMonth:"+currentDate.getMonth()+"<br/>";//获取当前月份(0-11,0代表1月)
     
     outStr=outStr+"getDate:"+currentDate.getDate()+"<br/>"; //获取当前日(1-31)
     
     outStr=outStr+"getDay:"+currentDate.getDay()+"<br/>";//获取当前星期X(0-6,0代表星期天)
      
     outStr=outStr+"getHours:"+currentDate.getHours()+"<br/>"; //获取当前小时数(0-23)
     
     outStr=outStr+"getMinutes:"+currentDate.getMinutes()+"<br/>";//获取当前分钟数(0-59)
     
     outStr=outStr+"getSeconds:"+currentDate.getSeconds()+"<br/>";//获取当前秒数(0-59)
     
     outStr=outStr+"getMilliseconds:"+currentDate.getMilliseconds()+"<br/>";//获取当前毫秒数(0-999)
     
     outStr=outStr+"toLocaleDateString:"+currentDate.toLocaleDateString()+"<br/>";//获取当前日期
     
     outStr=outStr+"toLocaleTimeString:"+currentDate.toLocaleTimeString()+"<br/>";//获取当前时间
     
     outStr=outStr+"toLocaleString:"+currentDate.toLocaleString()+"<br/>";//获取日期与时间
  • 相关阅读:
    hdoj 2041 超级楼梯
    hdoj 刚入门~把11页A了一些~~
    编写Powerdesigner脚本,快速生成数据库表
    网站
    duwamish
    面试题
    http://www.sqlclub.com
    Microsoft PetShop 3.0 设计与实现数据访问层
    Java代码查询站点
    从Blog上面去掉那该死的“狗狗订阅”的logo !
  • 原文地址:https://www.cnblogs.com/krisy/p/2818596.html
Copyright © 2011-2022 走看看