My timezone issue should be simple to figure out. But I am lost

Background:

I have an app that lets someone get a ticket after a certain date/time.

I add a record for my tickets, and enter in a date/time when they are available. I use Bubble’s datetime picker and default to the user’s timezone.

My users see a page which shows the date/time of when the tickets are available. They can’t click “give me a ticket” until a Countdown has expired.

So far, this has worked great.

BUT, in one case a user managed to get a ticket an hour early. Tickets weren’t available until 6pm, and he was able to get one at 5pm. He even sent me a screen shot which showed 5pm as the available time.

What the heck am I missing? Is my code wrong? Did this user find a way to manipulate his PC to fake out my app? Am I an idiot who is missing something obviously wrong? (Right now, I am leaning towards this last one as being the right answer).

Any help would be greatly appreciated.

Daylight saving time maybe?

Just like in traditional development, it’s a great idea to handle dates using UTC, or at the very least, stick to a fixed time zone for all date-related operations.

Relying exclusively on the user’s current time zone may leave your application vulnerable to manipulation, as users could easily deceive the system into believing its, say, 12 hours ahead.

I thought this might be the problem, too.

Thanks @newhorizoncode.

I’m going to try your suggestion. I’ve changed my date pickers to always use Central Time. And I made sure all displays of the time use the current user’s timezone.

This topic was automatically closed after 70 days. New replies are no longer allowed.