Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Made By Seven ([email protected])
- */
- var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
- function countdown(yr,m,d,divid)
- {
- theyear=yr;themonth=m;theday=d;div=divid;
- var today = new Date();
- var todayy=today.getFullYear();
- var todaym=today.getMonth();
- var todayd=today.getDate();
- var todayh=today.getHours();
- var todaymin=today.getMinutes();
- var todaysec=today.getSeconds();
- var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec;
- futurestring=montharray[m-1]+" "+d+", "+yr
- dd=Date.parse(futurestring)-Date.parse(todaystring)
- dday=Math.floor(dd/(60*60*1000*24)*1);
- dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1);
- dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1);
- dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1);
- setTimeout("countdown(theyear, themonth, theday, div);",1000);
- if(dday<=-1)
- {
- div.innerHTML = "날짜가 지나 사용할 수 없습니다.";
- }
- else
- {
- div.innerHTML = dday+ "일 "+dhour+"시간 "+dmin+"분 "+dsec+"초 남았습니다";
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement