Date.toLocaleString

書式

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

説明

地域(閲覧者の国や地域)に合わせた時間を文字列で返します。

サンプルコード [実行]

<!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();
dt = dateObj.toLocaleString();
document.write(dt);
// --></script>
</body>
</html>