samedi 28 février 2015

javascript making a jquery countdown work with UTC times


I am using this jquery countdown:


http://ift.tt/1AVC432


I initialize it like this:



<div id="clock"></div>
<script type="text/javascript">
$('#clock').countdown('2015/03/27 00:00:00')
.on('update.countdown', function(event) {
var format = '%H:%M:%S';
if(event.offset.days > 0) {
format = '%-D day%!d ' + format;
}
$(this).html(event.strftime(format));
})
.on('finish.countdown', function(event) {
$(this).html('FINISHED!');
});
</script>


The target time I use is in UTC but it will only work if people enter the site in UTC. I need to make it work in all the timezones, I mean, wherever the user is from it always has to see the same time left...


How can this be done?





Aucun commentaire:

Enregistrer un commentaire