Date.prototype.getMinutes()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

getMinutes() 메서드는 Date 인스턴스의 분을 현지 시간 기준으로 반환합니다.

시도해보기

const birthday = new Date("March 13, 08 04:20");

console.log(birthday.getMinutes());
// Expected output: 20

구문

js
dateObj.getMinutes();

반환 값

주어진 날짜의 현지 시간 기준 분을 나타내는 0에서 59 사이의 정수.

예제

getMinutes() 사용하기

다음 예제는 Date 객체 Xmas95의 분을 사용해 변수 minutes에 15를 할당합니다.

js
var Xmas95 = new Date("December 25, 1995 23:15:30");
var minutes = Xmas95.getMinutes();

console.log(minutes); // 15

명세

Specification
ECMAScript® 2025 Language Specification
# sec-date.prototype.getminutes

브라우저 호환성

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
getMinutes

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

같이 보기