JavaScript – toDateString() 方法
说明
JavaScript日期对象的 toDateString() 方法以易读的方式返回日期部分。
语法
其语法如下-
Date.toDateString()
返回值
返回一个以易读形式显示的日期部分。
示例
请尝试以下示例。
<html>   
   <head>
      <title>JavaScript toDateString Method</title>
   </head>
   <body>   
      <script type = "text/javascript">
         var dt = new Date(1993, 6, 28, 14, 39, 7);
         document.write( "Formated Date : " + dt.toDateString() );
      </script>   
   </body>
</html>
输出
Formated Date : Wed Jul 28 1993
极客教程