時刻を文字列に変換して返します.
dateObject.toTimeString()
toTimeStringメソッドは時刻を文字列に変換して返します. 文字列の具体的な内容は実装に依存します.
以下にtoTimeStringメソッドを使用したサンプルコードを示します.
<html>
<head>
<title>toTimeStringメソッドのサンプルコード</title>
</head>
<body>
<script type="text/javascript" language="javascript">
/* 本日日付を取得する */
var now = new Date();
document.write(now.toTimeString() + "<br />");
</script>
</body>
</html>
サンプルコードの実行結果は以下のようになります.
00:47:18 GMT+0900 (JST)
スポンサード リンク