Может быть поможет, попробуйте
<script language="javascript" type="text/javascript">
$(document).ready(function(){
function timer(){
var intervalid = setInterval(function(){
var now = new Date();
var endTS = 1355391990*1000;
var totalRemains = (endTS-now.getTime());
if (totalRemains>1){
var RemainsSec=(parseInt(totalRemains/1000));
var RemainsFullDays=(parseInt(RemainsSec/(24*60*60)));
var secInLastDay=RemainsSec-RemainsFullDays*24*3600;
var RemainsFullHours=(parseInt(secInLastDay/3600));
if (RemainsFullHours<10){RemainsFullHours="0"+RemainsFullHours};
var secInLastHour=secInLastDay-RemainsFullHours*3600;
var RemainsMinutes=(parseInt(secInLastHour/60));
if (RemainsMinutes<10){RemainsMinutes="0"+RemainsMinutes};
var lastSec=secInLastHour-RemainsMinutes*60;
if (lastSec<10){lastSec="0"+lastSec};
$('.timer>.digits').html((RemainsFullDays ? "<span>"+RemainsFullDays+"дн.</span> " :"")+RemainsFullHours+":"+RemainsMinutes+":"+lastSec);
}
else { clearInterval(intervalid); timer(); }
},1000);
}
timer();
});
</script>
|