Hola a todos..!
tengo este codigo.. q me crea un contador a la fecha q qiero... la fecha es 29 de dic.. pero necesito q sea hasta las 9 pm ese dia.. como agrego eso a mi codigo.. saludos!
Código:
eventDate = new Date(2011, 11, 29);
eventMillisecs = eventDate.getTime();
currentDate = new Date();
currentMillisecs = currentDate.getTime();
msecs = eventMillisecs-currentMillisecs;
if (msecs<0) {
msecs = 0;
}
secs = Math.floor(msecs/1000);
mins = Math.floor(secs/60);
hours = Math.floor(mins/60);
days = Math.floor(hours/24);
msecs = String(Math.floor(msecs%1000/10));
secs = String(secs%60);
mins = String(mins%60);
hours = String(hours%24);
days = String(days);
if (msecs.length<2) {
msecs = "0"+msecs;
}
if (secs.length<2) {
secs = "0"+secs;
}
if (mins.length<2) {
mins = "0"+mins;
}
if (hours.length<2) {
hours = "0"+hours;
}
while (days.length<2) {
days = "0"+days;
}
tiempo.text = days+" "+hours+":"+mins+":"+secs+":"+msecs;
updateAfterEvent();