Changing Time Zones

I have an application that records run training by folks.  There are users in other parts of the world and they are having trouble entering training because of the time zone issue.  The service does not allow them to enter training for a future date but it is basing that on something like this:

If CDate(TrngDate) > Date Then "You can't enter training for a future date."

How can this be  resolved?

Thank you.
Bob SchneiderCo-OwnerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Add a drop down box to allow them to select their current timezone, this can be either on the from where they enter their training date or under their login profile.

Then when they enter the date, based on their timezone you can work out the UTC value of the date and compare that to the current UTC date.
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
You can also guess the location by the ip.

I have been using smart ip and find it pretty accurate as compared to some other services.  I use this a lot when people submit forms to help detect spam.  But you can pull out the country, state then compare that to another free web service to look up the time zone

In one of my databases, I seem to remember importing the time zones from some place and have used that.

Now that you have this data, use n-w's solution to convert all dates to UTC and use UTC as the comparison.

Of course, you could also just update your asp code to just accept any dates within 1 day of the current day too.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I found a source to download the time zones  You can also use the api and submit the IP to capture the time zone.
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Bob SchneiderCo-OwnerAuthor Commented:
Thanks a ton as usual.
Bob SchneiderCo-OwnerAuthor Commented:
oops...only gave one of padas' contributions points.  That was an oversight.  My apologies.
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
It's all good. Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.