<SCRIPT language=JavaScript>
function getTime()
{
now = new Date();
dday = new Date( ".$row[it_enddate]." );
days = (dday - now) / 1000 / 60 / 60 / 24;
daysRound = Math.floor(days);
hours = (dday - now) / 1000 / 60 / 60 - (24 * daysRound);
hoursRound = Math.floor(hours);
minutes = (dday - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
minutesRound = Math.floor(minutes);
seconds = (dday - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
secondsRound = Math.round(seconds);
}
위에처럼 ".$row[it_enddate]."라고 하면 Nan일 Nan시간 이런식으로 나오는데요.
그냥 2013,05,30,00,00,00라고 입력하면 정상적으로 남은시간 이 출력됩니다.
자바스크립트 안에서 날짜가 2013,05,30,00,00,00 로 정확하게 불러올려면 어디를 바꾸면 될까요.
* $row[it_enddate] 는 2013,05,30,00,00,00로 정확하게 입력되었는데 자바스크립트에 넣기만 하면
Nan일 Nan 시간 등으로 나옵니다. 부탁드립니다.
function getTime()
{
now = new Date();
dday = new Date( ".$row[it_enddate]." );
days = (dday - now) / 1000 / 60 / 60 / 24;
daysRound = Math.floor(days);
hours = (dday - now) / 1000 / 60 / 60 - (24 * daysRound);
hoursRound = Math.floor(hours);
minutes = (dday - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
minutesRound = Math.floor(minutes);
seconds = (dday - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
secondsRound = Math.round(seconds);
}
위에처럼 ".$row[it_enddate]."라고 하면 Nan일 Nan시간 이런식으로 나오는데요.
그냥 2013,05,30,00,00,00라고 입력하면 정상적으로 남은시간 이 출력됩니다.
자바스크립트 안에서 날짜가 2013,05,30,00,00,00 로 정확하게 불러올려면 어디를 바꾸면 될까요.
* $row[it_enddate] 는 2013,05,30,00,00,00로 정확하게 입력되었는데 자바스크립트에 넣기만 하면
Nan일 Nan 시간 등으로 나옵니다. 부탁드립니다.
게시글 목록
| 번호 | 제목 |
|---|---|
| 56073 | |
| 56067 | |
| 56065 | |
| 56060 | |
| 56058 | |
| 56055 | |
| 56051 | |
| 56048 | |
| 56044 | |
| 56043 | |
| 56042 | |
| 56039 | |
| 56035 | |
| 56032 | |
| 56030 | |
| 56028 | |
| 56025 | |
| 56018 | |
| 56012 | |
| 56010 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기