Date.toDateString

書式

日付オブジェクト.toDateString()

説明

「Thu Sep 28 2006」のような日付文字列を返します。Opera 9では若干形式が異なる上に曜日の後にカンマが入り「Thu, 28 Sep 2006」のようになります。Internet Explorer 5.5より古いバージョンでは動作しません。

サンプルコード [実行]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
</head>
<body>
<script type="text/javascript"><!--
dateObj = new Date();
dtStr = dateObj.toDateString();
document.write(dtStr);
// --></script>
</body>
</html>