코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>JavaScript Date Method</title> </head> <body> <h1>setFullYear() 메소드</h1> <script> var date = new Date(); date.setFullYear(1982, 1, 19); // 자바스크립트에서 2월은 1임. document.write(date.getFullYear() + "<br>"); // 1982 document.write(date.getMonth() + "<br>"); // 1 document.write(date.getDate() + "<br>"); // 19 document.write(date); </script> </body> </html>