wood burning stoves 2.0*
The moose likes Tomcat and the fly likes getting country name from time zone Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "getting country name from time zone" Watch "getting country name from time zone" New topic
Author

getting country name from time zone

Dino Veer
Greenhorn

Joined: Mar 22, 2012
Posts: 5

I am working on getting data from twitter APIs(twitter4j). One problem is that sometimes I get only timezone like 'Pacific Time (US & Canada)'. Is there some way to get countryname using this info. One way can be to trim the timezone string from Pacific Time (US & Canada) to US & Canada. Any other way?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

A time zone extends from pole to pole in a stretch covering an entire 1/24th area of the planet, subject to adjustments for national convenience. The "US & Canada" is simply an indication that the locale is set for the zone where a specific set of rules apply for base time offset from GMT and when Daylight Savings start and end. As a determinant of national boundaries, it's pretty useless. I live in a state that spans 2 separate zones, myself, and for a while I crossed the zone boundary on a regular basis.


Customer surveys are for companies who didn't pay proper attention to begin with.
K. Gil
Ranch Hand

Joined: Apr 29, 2011
Posts: 75

This is how I solved similar problem in the past:

GeoLite Free Downloadable Databases
http://dev.maxmind.com/geoip/geolite
These databases are offered in the same binary and csv formats

happy geoCoding
 
wood burning stoves
 
subject: getting country name from time zone
 
Similar Threads
Java TimeZone: How to get current date and daylight saving
output TimeZone list as "America/Los_Angeles")
Problem computing time based on TimeZones
Getting system timezone in Javascript
Changing TimeZone of Date.