I'm trying to parse "Time Left To Buy" from a Groupon clone. Don't worry, everything is legal. The Javascript looks like
var untilDate =开发者_JAVA百科 new Date(1316206740000);
$("#wlt-DealTimeLeft .timer").countdown({until: untilDate,
layout: "<div class='timerDiv withDay clearfix'><div class='countdownItem days'><p>{dn}</p>{dl}</div><div class='countdownItem'><p>{hn}</p>{hl}</div><div class='countdownSep'>:</div><div class='countdownItem'><p>{mn}</p>{ml}</div><div class='countdownSep'>:</div><div class='countdownItem'><p>{sn}</p>{sl}</div></div>", onTick: function(periods){
$("#wlt-DealTimeLeft").uTimeLeftTick(periods,259080);
}});
I was thinking about the Date value, but it isn't only regular unix timestamp. How can I get the date when the deal ends? It's some kind of jQuery countdown plugin. Thank you for any hints or advices.
javascript Date objects take milliseconds, not seconds, so
var d= new Date(1316206740000);
document.write(d); //outputs Fri Sep 16 17:59:00 UTC-0300 2011
精彩评论