Date.prototype.getMilliseconds()
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.
getMilliseconds()
메서드는 Date
인스턴스의 밀리초를 현지 시간 기준으로 반환합니다.
시도해보기
const moonLanding = new Date("July 20, 69 00:20:18");
moonLanding.setMilliseconds(123);
console.log(moonLanding.getMilliseconds());
// Expected output: 123
구문
js
dateObj.getMilliseconds();
반환 값
주어진 날짜의 현지 시간 기준 밀리초를 나타내는 0에서 999 사이의 정수.
예제
getMilliseconds()
사용하기
다음 예제에서는 현재 시간의 밀리초를 변수 milliseconds
에 할당합니다.
js
var today = new Date();
var milliseconds = today.getMilliseconds();
명세
Specification |
---|
ECMAScript® 2025 Language Specification # sec-date.prototype.getmilliseconds |
브라우저 호환성
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
getMilliseconds |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.