Need help with a countdown timer (specifically the "base" time)

Here is what I have:

I have a countdown timer (a plugin) that shows how many days, hours, minutes and seconds there are before the user can click a button, based on the difference between the system time (Current time/time) and my “dateAvailable” data value.

So if my PC says it’s 4pm and my dateAvailable is 6pm, it will show there are 2 hours left.

And here is my problem:

The user can change their PC’s clock to read 5pm, which means on their PC, there would be only ONE hour left, so they’d be able to click the button a full hour before anyone else.

I understand that the countdown timers use the system time, but since the user can change the system time they can also cheat the system by just changing their PC’s clock.

So my question is 2-part.

  1. Is there a countdown timer that uses a calculated date time instead of system time to show the time remaining.
  2. Or is there some way to show this remaining time on my own without having to manually calculate days, hours, mins and seconds remaining. To do this, I’d need to change my calculated system time every second, which I have found to be horribly erratic.

Or perhaps there is something stupidly simple that I’m missing.

Any help would of course be much appreciated.

Why can’t you just do dateAvailable - Current DateTime formated as and then just use some conditions to display the way you want? No plugin needed, am i missing something?

@luke.ford Sir i Current Date Time uses browser time , that what being used to bypass time limit.

@firstfifteensoftware What i suggest, is get user timezone, and get current time for that time zone using API call for time, and check it against this time.

you can use http://worldtimeapi.org/ if you want help implementing it or further debugging ping me any time. i would love to be helpful.

That’s kind of what I’m doing.

The page is like when you are selling concert tickets which will be available for purchase tonight at 6pm.

Assume it’s now 4pm. The “buy a ticket” button won’t show up for 2 more hours.

BUT if I change my browser time from 4pm to 6pm, my page will think it’s time to let buyers get a ticket, even though it’s actually still 4pm.

@firstfifteensoftware as i told you, the best possible solution is to take user timezone outside of his browser, then we only open the purchasing slot for him when the actual time is right.

I can help you for free

OK, that sounds like it would work.

But can’t the user change their timezone if they are on a VPN?

No,if you take user current time zone they can try be in a different time zone.

I think the time zone will be same as the event is happening, or ticket being sold for.

Or maybe ask user there time zone when they sign up.

There will always be caveat unfortunately