我有下面这样的代码,我想为它设置时区。我可以知道我该怎么做吗?
代码:
<script type="text/javascript">
$(function () {
var year = new Date();
year = new Date(year.getFullYear(), 11 - 1, 20);
$('#dvCountDown').countdown({
until: new Date('2013-02-08'),
format: 'HMS',
onExpiry: liftOff
});
$('#CountdownbyValue').countdown({
until: '0h +0m +8s',
format: 'HMS',onExpiry: liftOff
});
$('#year').text(austDay.getFullYear());
//Time is up!
function liftOff() {
alert('Time is up!');
}
});
</script>
尝试使用这个:
var year = new Date();
year.setUTCMonth(11 - 1);
year.setUTCDay(20);
year.setUTCHour( /* your timezone offset */ );
year.setUTCMinutes( /* your timezone offset */ );
year.setUTCSeconds(0);
$('#dvCountDown').countdown({
until: new Date(Date.UTC(2013, 2-1, 08)),
format: 'HMS',
onExpiry: liftOff
});