Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015년 7월.
getFullYear() 메서드는 주어진 날짜의 현지 시간 기준 연도를 반환합니다.
getYear() 메서드 대신 이 메서드를 사용하세요.
현지 시간에 따라, 주어진 날짜의 연도에 해당하는 숫자.
getFullYear()가 반환하는 값은 절댓값입니다. getFullYear()는 1000년과 9999년 사이의, 1995년과 같은 날짜에 대해서는 네 자리 숫자를 반환합니다. 이 메서드를 사용해야 2000년 이후의 날짜에 대해서도 호환을 유지할 수 있습니다.
다음 예제에서는 현재 연도의 네 자릿값을 변수 year에 할당합니다.
| ECMAScript® 2027 Language Specification # sec-date.prototype.getfullyear |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 2월 11일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.