JavaScript的Date()方法使用详解

时间:2015-06-09    点击:41   

JavaScript的Date()方法返回今天的日期和时间,并且不需要任何对象被调用。
语法

Date()

下面是参数的详细信息:

  •     NA

返回值:

返回今天的日期和时间
例子:

<html>
<head>
<title>JavaScript Date Method</title>
</head>
<body>
<script type="text/javascript">
  var dt = Date();
  document.write("Date and Time : " + dt ); 
</script>
</body>
</html>

这将产生以下结果:

Date and Time : Wed Aug 27 2008 20:12:50 GMT+0530 
        (India Standard Time)

JavaScript获取数组最小值和最大值的方法
JavaScript获取两个数组交集的方法
JavaScript实现函数返回多个值的方法
JavaScript中的getDay()方法使用详解
JavaScript中用getDate()方法返回指定日期的教程
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved