ホーム > Date > toUTCString

toUTCString

協定世界時の日付を文字列に変換して返します.

シンタックス

dateObject.toUTCString()

解説

toUTCStringメソッドは日時を文字列に変換して返します. この時,協定世界時の形式で変換を行った結果を返します. 文字列の具体的な内容は実装に依存します.

サンプルコード

以下にtoUTCStringメソッドを使用したサンプルコードを示します.

<html>
  <head>
    <title>toUTCStringメソッドのサンプルコード</title>
  </head>
  <body>
    <script type="text/javascript" language="javascript">
      /* 本日日付を取得する */
      var now = new Date();
      document.write(now.toUTCString() + "<br />");
    </script>
  </body>
</html>

実行例

サンプルコードの実行結果は以下のようになります.

Sun, 13 Dec 2009 15:38:34 GMT

関連項目

スポンサード リンク

inserted by FC2 system