回到目录

 

  1. 日期对象:Date;(日期基线:1970年1月1日00:00:00)

    建立日期对象(实例):

      格式:日期对象名称=new Date([日期参数])

      日期参数:1.省略;
           2.英文-数值格式:月 日,公元年 [时:分:秒]
             如:today=new Date("October 1,2008 12:00:00")
           3.数值格式:公元年,月,日,[时,分,秒]
             如:today=new Date(2008,10,1)

    日期对象的方法:

      格式:日期对象名称.方法([参数])

    获取当地时间:
    getYear() 返回年份数
    getFullYear() 返回年份数
    getMonth() 返回月份数(0--11)
    getDate() 返回日期数(1--31)
    getDay() 返回星期数(0--6)
    getHours() 返回时数(0--23)
    getMinutes() 返回分数(0--59)
    getSeconds() 返回秒数(0--59)
    getMilliseconds() 返回毫秒数(0--999)
    getTime() 返回对应日期基线的毫秒
    Date.parse(日期字串) 返回对应日期基线的毫秒
    setTime(时间值) 指定一日期对象的值
    toGMTString() 以GMT格式表示日期对象
    toUTCString() 以GMT格式表示日期对象


asp之家,致力于为Asp学习者提供专业而高质量的建站内容!
m.aspxhome.com