From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../global_objects/date/getseconds/index.html | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/date/getseconds/index.html (limited to 'files/ja/web/javascript/reference/global_objects/date/getseconds') diff --git a/files/ja/web/javascript/reference/global_objects/date/getseconds/index.html b/files/ja/web/javascript/reference/global_objects/date/getseconds/index.html new file mode 100644 index 0000000000..44ace675f4 --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/date/getseconds/index.html @@ -0,0 +1,66 @@ +--- +title: Date.prototype.getSeconds() +slug: Web/JavaScript/Reference/Global_Objects/Date/getSeconds +tags: + - Date + - JavaScript + - Method + - Prototype + - Reference +translation_of: Web/JavaScript/Reference/Global_Objects/Date/getSeconds +--- +
{{JSRef}}
+ +

getSeconds() メソッドは、地方時に基づき、指定した日時の「秒」を返します。

+ +
{{EmbedInteractiveExample("pages/js/date-getseconds.html")}}
+ + + +

構文

+ +
dateObj.getSeconds()
+ +

返値

+ +

地方時に基づき、与えた日付の「秒」を表す 0 から 59 までの間の整数値。

+ +

+ +

getSeconds() の使用

+ +

以下の 2 行目の文は、{{jsxref("Global_Objects/Date", "Date")}} オブジェクト Xmas95 の値に基づき、変数 seconds に 30 という値を代入します。

+ +
var Xmas95 = new Date('December 25, 1995 23:15:30');
+var seconds = Xmas95.getSeconds();
+
+console.log(seconds); // 30
+
+ +

仕様書

+ + + + + + + + + + + + +
仕様書
{{SpecName('ESDraft', '#sec-date.prototype.getseconds', 'Date.prototype.getSeconds')}}
+ +

ブラウザーの互換性

+ + + +

{{Compat("javascript.builtins.Date.getSeconds")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf