A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/ja/docs/Web/JavaScript/Reference/Global_Objects/Date/getMinutes below:

Date.prototype.getMinutes() - JavaScript | MDN

Date.prototype.getMinutes()

Baseline Widely available

getMinutes() は Date インスタンスのメソッドで、地方時に基づき、指定された日時の「分」を返します。

試してみましょう
const birthday = new Date("March 13, 08 04:20");

console.log(birthday.getMinutes());
// 予想される結果: 20
構文 引数

なし。

返値

地方時に基づき、指定された日時の「分」を表す 0 から 59 までの間の数値です。日時が無効な場合は NaN を返します。

例 getMinutes() の使用

変数 minutes には、 Date オブジェクト xmas95 に基づいて、 15 という値が入ります。

const xmas95 = new Date("1995-12-25T23:15:30");
const minutes = xmas95.getMinutes();

console.log(minutes); // 15
仕様書 ブラウザーの互換性 関連情報

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4