Changing Time Zones

Posted on 2013-09-08
Medium Priority
Last Modified: 2013-09-09
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.
Question by:Bob Schneider
  • 3
  • 2

Assisted Solution

N-W earned 1000 total points
ID: 39475316
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.
LVL 54

Accepted Solution

Scott Fell,  EE MVE earned 1000 total points
ID: 39475349
You can also guess the location by the ip.

I have been using smart ip http://smart-ip.net/ 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 http://www.earthtools.org/webservices.htm#timezone.

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.
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39475385
I found a source to download the time zones http://timezonedb.com/  You can also use the api and submit the IP to capture the time zone.
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.


Author Closing Comment

by:Bob Schneider
ID: 39475862
Thanks a ton as usual.

Author Comment

by:Bob Schneider
ID: 39475976
oops...only gave one of padas' contributions points.  That was an oversight.  My apologies.
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39476103
It's all good. Thanks!

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In this article, we will show how to detach and attach a database and then show how to repair a corrupt database and attach it, If it has some errors. We will show how to detach and attach using SSMS or using T-SQL sentences.
An ASP.NET Web Form User Control is not newly introduced in ASP.NET. In fact, it was an old technology yet still playing a role to generate web content, especially when we want to use it to have a better and easy way to control part of the web conte…
The viewer will learn how to dynamically set the form action using jQuery.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question