그 두 Date 객체가 콘솔에서 다른 출력을 갖는 이유가 궁금합니다. 내 의견으로는 동일해야하지만이 Date 객체가 다른 이유는 무엇입니까?
,twoLinesSetup
var twoLinesSetup = new Date(); twoLinesSetup.setHours(0, 0, 0); var inlineSetup = new Date().setHours(0, 0, 0) console.log('twoLinesSetup', twoLinesSetup); console.log('inlineSetup', inlineSetup);
그리고 콘솔 : 잘못 될 수 있습니다 : 월 2017년 5월 8일 0시 0 분 0 초 그리니치 표준시 + 0200
inlineSetup : 1494194400521
왜 그렇습니까?
'setHours()'는 밀리 초를 숫자로 반환하기 때문에'Date' 인스턴스가 아닙니다. – Bergi