-1

I'm trying to make a custom countdown timer that resets itself every 12 hours and won't reset on every refresh or by closing the window.

EXAMPLE - Like I've a shopping site and want to show COUNTDOWN Timer there which shows in this format (hh:mm:ss) with unlimited loop ... and it must not reset by closing the browser or window.

I think the ideal way to do this is via timezone?

Any kind of solutions are welcomed...

I need exactly like this type of countdown timer - http://www.bedeals.com/

APEX
  • 47
  • 1
  • 2
  • 13
  • 1
    If you want it to be the same across clients and not change with refreshes. Then you are begging for a simple server that can deliver the time of the countdown. From there you use ajax to get updates to the countdown. – t3dodson May 23 '15 at 20:21

1 Answers1

1

You may persist the timer state in localStorage . Simply add the time of start there and every time you get into the page read the value and apply some functions to get current time ( based on obtained value ). The apply setInterval to update the timer on the page dynamically.

Date formatting is described here.

Community
  • 1
  • 1
zmii
  • 4,123
  • 3
  • 40
  • 64