• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

timezone information from zipcode

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I wanted to know if there is way in java to get the timezone information from zipcode.

Thanks,
Samanth marisetty.
 
Marshal
Posts: 27366
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not in the standard Java API, but if you have access to the Internet you could send a request to this web service.
 
Sam Venkata
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul,

But I want to be able to send zipcode from my java program and be able to get the timezone information back. Is that possible?

Thanks,
Samanth Marisetty.
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's exactly what that service provides, isn't it?

Get State Code,City,Area Code,Time Zone,Zip Code by Zip Code



If it's accessible through a web page (in other words, HTTP), then you can write a Java client that accesses it.
 
Sam Venkata
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I got the wsdl from the service you mentioned and generate classes using wsdl2java axis tool.


is the method generated to get the info based on zip, but the response object
NET.webserviceX.www.GetInfoByZIPResponseGetInfoByZIPResult does not have any information about the timezone and also I see some classes like
GetInfoByAreaCode, GetInfoByCity, GetInfoByState but not GetInfoByZipCode.
Is there anything that could be missing in the wsdl? I tried to compare the operations, bindings aswell but could not find anything missing.

could somebody please help me..

Thanks,
Samanth.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, if I submit a request like

http://www.webservicex.net/uszip.asmx/GetInfoByZIP?USZip=94102

I get the following response:

Apparently the time zone "P" statnds for Pacific time. Similarly "M" is used for Mountain time. Unfortunatly this undocumented, craptastic system does not allow them to distinguish between Denver (which uses Daylight Saving Time in the summer) and Phoenix (which does not). So I'm not sure how useful it really is. It's also extremely slow. Which may be fair, considering it's free. But I think you might spend some time googling

"zip code" "time zone" "web service"

to see what other similar services are out there. There are several that provide more info, including daylight saving info, for a price. There may be another free service with better info; I don't know. You can also purchase raw data files from various sources which allow you to look up this info more directly on your server, without hitting a web service each time.
 
Happily living in the valley of the dried frogs with a few tiny ads.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic