目录

toGMTString()

描述 (Description)

Javascript date toGMTString()方法使用Internet GMT conventioins将日期转换为字符串。

不再使用此方法,并且已由toUTCString方法替换。

语法 (Syntax)

其语法如下 -

Date.toGMTString()

返回值 (Return Value)

使用Internet GMT conventioins返回字符串的日期。

例子 (Example)

请尝试以下示例。

<html>
   <head>
      <title>JavaScript toGMTString Method</title>
   </head>
   <body>
      <script type="text/javascript">
         var dt = new Date(1993, 6, 28, 14, 39, 7);
         document.write( "Formated Date : " + dt.toGMTString() ); 
      </script>
   </body>
</html>

输出 (Output)

Formated Date : Wed, 28 Jul 1993 09:09:07 GMT
↑回到顶部↑
WIKI教程 @2018