Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating time for a particular location

Status
Not open for further replies.

BobTheMad

Programmer
Jun 11, 1999
81
US
I am writing a local GUI app that displays various location data. One of the features I would like to add is the ability to do a "local" time lookup for a specific location (probably by zip-code). Is anyone aware of a free web-service or API that I can query to get this information?

Thanks!

Thought for the day: Beware of Gods who cannot laugh...
 

Well, it isn't be much trouble getting the time zone info (name, bias) from the registry for all time zones and then calcualting the current time for each zone.
I've got code for this if if you want.
The user could then to pick their time zone.

I have no idea though, if the zip codes are always within a certain time zone, (in which case you would need a list of all zip codes and which time zones they belong to), or if they could overlap time zones, (in which case that then wouldn't always work).
 
dglienna, thanks for your suggestion, but it does not meet the criteria I was looking for. This is a desktop GUI that I need to be able to display local time for various US locations. I would rather not go the route of having to parse out an HTML page, therefore I was looking for a web-service (or something else) where I could pass location information (city/state, zip code, etc). The link you sent does not do this.

SBerthold, I was hoping to make this fairly idiot-proof. I want to have someone here at the office, punch in a location, and have that location's current time displayed (along with all other relavant information). It is my understanding that zip codes do not split across time zones... even if they do, I can accept that small level of discrepancy.

Thanks!

Thought for the day: Beware of Gods who cannot laugh...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top