Countdown to a specific date

前端 未结 3 960
北恋
北恋 2021-01-21 23:28

What I\'m trying to do seems like it should be simple but is proving tricky. I need a countdown script that uses a target date and gives me three separate figures - namely Days,

相关标签:
3条回答
  • 2021-01-21 23:42

    In the example you get seconds by subtracting the two time objects so lets start there:

    totalseconds % 60, remainder of seconds
    totalseconds / 60, total minutes

    0 讨论(0)
  • 2021-01-21 23:46

    Have you seen this plugin? http://www.keith-wood.name/countdown.html

    0 讨论(0)
  • 2021-01-21 23:51

    You should be able to do the math yourself and print it out. Use modulus to get the remainder in minutes and then floor the days.
    In the example you get seconds by subtracting the two time objects so lets start there:
    totalseconds % 60, remainder of seconds
    totalseconds / 60, total minutes
    totalminutes % 60, remainder of minutes
    etc...

    See for code: http://jsfiddle.net/jHVnz/

    0 讨论(0)
提交回复
热议问题