JavaScript系列(2)-内置对象:Date

Date 对象

Date 对象用于处理日期和时间。

创建 Date 对象的语法:

实列:

var myDate=new Date()(Date 对象会自动把当前日期和时间保存为其初始值。)
alert(date.toString());//获取中国标准时间
alert(date.toLocaleString());//获取当前时区的当前时间

Date 对象方法:

猜你喜欢

转载自blog.csdn.net/qq_26347097/article/details/81572309