What database does Maxmind use for timezone IDs? - timezone

I'm using Maxmind's GeoIP2 products to extract timezone IDs and then using JodaTime to parse/manipulate those timezones. I've noticed that there are timezones that are returned form GeoIP2 that are not in JodaTime's available list of timezones, such as "Europe/Kirov"
I'd like to properly parse all timezones, but without insight into what timezone database/directory Maxmind is using, I don't know how to begin. Does anyone know what they're using?

MaxMind pulls the geographical data in GeoIP2 from GeoNames, which uses the IANA Time Zone Database. See this file for Europe/Kirov. This entry was added in the 2016d release of the IANA database. JodaTime 2.9.4 should include it.

Related

Apply timezone by id on Power BI

(Here's quite the same question I opened on Microsoft Power BI community forum)
I have a table in my database where I have a column with datetime values in UTC and another column with the timezone of this datetime (a string containing the IANA id of the timezone, like "America/Sao_Paulo").
I must generate in Power BI a new column with the DateTimeZone value corresponding to the given datetime in UTC converted to the given timezone, and it must work on Power Bi Desktop and also on cloud (Power BI embedded).
I searched through Power Query M and DAX docs, but could only find ways to apply timezone to a datetime using numbers (e.g. -10), but not using IANA IDs... (It's important for me to use the timezone id instead of simple numbers because of Daylight Saving Time).
I tried Reza Rad's idea of using a Web Query with Power Query in the past, but it turns out that online Power BI won't let me use web query and simply won't update my data source (which is a hard requirement to me). Furthermore, their method doesn't solve my exact situation, as I should still figure out which website to send request and which structure to use on my report. (I'm open to suggestions on this matter)
There's a similar thread on Power BI community forum, still with no solution.
Could someone help me apply the timezones to the datetimes, be it using Power Query M, DAX or other workarounds on Power BI?
Question:
but it turns out that online Power BI won't let me use web query and simply won't update my data source (which is a hard requirement to me).
You need a gateway connection for the Online Power BI to work. In Online Power BI, the schedule refresh needs a gateway to refresh Web-Queries or local Folder/File Queries.
Procedure:
You need to install Data Gateway on your PC from here
I think in your particular case, you can install the Personal Gateway.
Instructions to install personal gateway: https://www.youtube.com/watch?v=xjcO5tNvjGs
Once you install it, Please follow the following steps:
Go to the dataset settings in your Power BI Service and click on Gateway connection, your personal gateway will be automatically selected.
After that edit your Data Source credentials and choose Anonymous.
Once this is done, you can toggle the Schedule refresh on for your dataset.
Screenshot below:
Note: I've tested this and its working fine.
If you'd like to get the information of the timezone as a query, the you can use the following Wikipedia link as the data-source and extract the timezone table from it.
I have tried it and it gets the data (Screenshot below). Once you get the data as query, you can create relationships or you can merge this with your query.
Please check if this helps you.

How do I get a list of timezone names of a browser

I want to get the browser specific timezone names (different browsers displays different text for each system setting) for system available time zones. I need the exact string of the timezone that are in the "()" when writing console.error(new Date()) but not just for my current settings, without changing my OS settings and restarting the browser each time.
AFAIK js libraries uses their own name lists to solve this but the resulting names are different from the browser timezone name. I need the name as the browser will write it.
Thanks.
It was not possible when the question was asked, but with the Intl.supportedValuesOf it is possible in modern engines:
console.log(Intl.supportedValuesOf('timeZone'));
At the time of this writing, you can ask for "calendar", "collation", "currency","numberingSystem", "timeZone" and "unit".
Intl.supportedValuesOf('timeZone') now provides the list of all available timezones on some browsers, including Safari and Chrome for iOS caniuse.com.

Rails time zones

I'm calling an external web service API that returns a timezone as listed in the Olson timezones database (e.g. "America/New_York"). However some of the values the API returned are "US/Pacific", "US/Eastern" and apparently don't match any of the Olson timezones in Rails 2.3.2. Can anyone shed some light on this? Thanks in advance for your help.
I don't know why they're being returned by the particular API you're using, but those entries do exist in the PHP timezone implementation (and maybe others), with the warning "Please do not use any of the timezones listed here (besides UTC), they only exist for backward compatible reasons."
I guess Rails uses a stricter implementation.

Finding local time zones in rails

I'm wondering if there is an easy way to look up a user's local time zone in Rails using only an IP address. I don't want users to have to input their time zone themselves. Do I have to use JavaScript or is there a different way?
The maxmind GeoLite IP->city database seems to support timezones and there's a FAQ on their site referring to this. You could either do a two-step process of IP->Location then Location->timezone using the Maxmind GeoLite City database and then use one of the solutions provided in the FAQ.
Or for a simple 1-step javascript, using getTimezoneOffset() seems to be the crux of the solution.
There appear to be several vendors offering APIs and callable services to go from ip address to location, and clearly once you have that determining the timezone is only a further lookup.
Your alternative of using javascript to ask the browser "where am I, what's the time zone" and Ajaxing that down to your server also sounds plausible.
Of course a sufficiently determined user can probably spoof their way to appearing to be at a different ip address, but presumably that doesn't matter too much to you ... their choice.
you can use the ip address-to-time API to find time by IP address.
Look here http://worldtimeengine.com/ for more details.
Dan

All Countries States Cities and Zipcodes in a Application

Is there a way getting all countries, states,cities zipcodes/ in one single database.
I have been looking all over.
I discovered geonames.org, which has I guess all of the content. But there is no way to fetch that data directly.
I am using rails. If there any helpers or Plugins, it'd be great. It would be awesome if there is a complete resource in any parsable format which I can use to get this database in place.
Please recommend if you any thanks
I do have the iso country code list but no States for some countries.
Thanks in advance
Thanks Guys,
I got all the the countries and states of all of them, but no zip codes.
http://27.org/isocountrylist/iso_country_list.sql
This contains all countries, and there iso-3166 codes ( Siberia code needs to be changed from "CS" to "RS")
And here is the FIPS file for countries with states
http://www.maxmind.com/app/fips_include
For zip code validation I am using
http://www.geonames.org webservices
There is a geonames ruby gem as well, which makes it really simple to do zipcode validations
Hope that helps anybody who needs this information, worth keeping it handy for web projects.
Another Link ( thanks #laise ): http://dev.maxmind.com/static/csv/codes/maxmind/region.csv
The Carmen plugin is almost certainly what you're looking for.
This will take a little legwork and data munging, but it's not too bad.
Countries and country codes are easy to come by. Sounds like you already have them.
Not all countries are divided into states. You may have to simply address these one by one-- there may be some combined reference, but not that I know of.
U.S. cities are available, and look for things like FIPS codes. There are commercial data providers that will provide you clean, well-organized data, but they are charging for it.
The post office has some databases with all the zip codes. Note that these charge periodically, and a single zip code doesn't imply a single single (far from it!). And it may not be necessary to actually have a database of all of them, as there are zip verification/correction services available for free.
For loading the data, check out a recent railscast on the subject.
I was looking for the same and found this resource. I hope somebody serves well as me.
http://dev.mysql.com/doc/world-setup/en/index.html
For those using the FIPS 10-4/FIPS 5-2 standard, I have been maintaining the NGA GEC (formerly FIPS 10-4/5-2) Excel spreadsheet (original format) for 1st level administrative divisions of countries. The spreadsheet is currently updated to Update 15 (March 2014):
http://www.opengeocode.org/archive.php

Resources