I am using javascript for a count down timer
<script type="text/javascript">
$(function() {
var newYear = $(".HF").val();
alert('hehe' + newYear);
$('#countdown').countdown({ until:newYear, format: 'DHMS', layout:
'<div id="timer">' + '<hr />' +
'<div id="timer_days" class="timer_numbers">{dnn}</div>' +
'<div id="timer_hours" class="timer_numbers">{hnn}</div>' +
'<div id="timer_mins" class="timer_numbers">{mnn}</div>' +
'<div id="timer_seconds" class="timer_numbers">{snn}</div>' +
'<div id="timer_labels">' +
'<div id="timer_days_label" class="timer_labels">days</div>' +
'<div id="timer_hours_label" class="timer_labels">hours</div>' +
'<div id="timer_mins_label" class="timer_labels">mins</div>' +
'<div id="timer_seconds_label" class="timer_labels">secs</div>' +
'</div>' +
'</div>'
});
});
</script>
it gets its until value from a hidden field HF.The value of the hidden field is a string 10/22/2011…but the timer shows only 34 mins left while it must show 2 days and some hours and some mins left..why??
The
newYearstring has to be converted to aDateobject: