I'm developing an newsletter sending application on C#/.NET platform. I've recently added the module to retrieve the country and region of a recipient by his IP address using maxmind.com database.
For example, I can get the following info for some sample IP address:
Country Code: DE
Country Name: Germany
Region Name: Hessen
City: Frankfurt Am Main
Latitude: 50.1167
Longitude: 8.6833
What I need now is to get the user's time zone using this information.
I know there are some GeoIp databases that provide also the time zone, but I need to use this concrete GeoIp database. Also, javascript's approach to determine time offset can't be used here.
May be I can get somehow the timezone using country and region name?
Finally, after long research, I've found the solution. It may not be much accurate, but it does not require the dependency of remote service.
I've found that maxmind's database provides mapping file between regions and time zones from Olsen database (aka tz database): http://www.maxmind.com/timezone.txt
The second step was to convert Olsen timezones in .NET timezones. The best suitable solution was found here: http://www.timdavis.com.au/data/olson-time-zone-database-to-standard-windows-time-zone-v01/ So I've edited it a bit and converted it to CSV file to read it from .NET.
Hope it will help somebody.
It's been a while since this question was asked, but might help others ..
When you are using a DatabaseReader Object from maxmind API in there has already an attribute
location.timeZone
you can retrieve it from the object returned by GeoIP Class, check out on API docs from maxmind.See the following links
http://johnwsaundersiii.spaces.live.com/blog/cns!600A2BE4A82EA0A6!657.entry
How to get time zone information for country?