Click here to Skip to main content
15,886,634 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to create an auction app , where every 4-5 minutes a new product is shown to the users which they can either participate or reject from entering. So what I want to do is run a global counter every 4-5 minutes for all the users i.e all the users get the same counter timings.

What I have tried:

I have found no solution for it yet
Posted
Updated 11-Aug-21 12:30pm

1 solution

Quote:
How do I create a countdown timer which is same for all users ?

Said simply, you need a single time reference, server clock is a good candidate.
With server actual time and time of end of auction, you calculate a duration until end of auction, that duration is what you transmit to users.
Then locally you set a timer with that duration.
This way, every user will have same countdown, no matter its timezone.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900