코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>JavaScript Date Method</title> </head> <body> <h1>getFullYear() 메소드</h1> <script> var date = new Date(); document.write("올해는 " + date.getFullYear() + "년입니다."); // 현재 연도를 반환함. </script> </body> </html>