开发者

Parse date from javascript countdown (jQuery plugin)

开发者 https://www.devze.com 2023-04-05 00:11 出处:网络
I\'m trying to parse \"Time Left To Buy\" from a Groupon clone. Don\'t worry, everything is legal. The Javascript looks like

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
0

精彩评论

暂无评论...
验证码 换一张
取 消