I'm hoping somebody can resolve my issue with daylight savings and the country Jordan. According to joda-time 2.2 and 2.3 (at least), Jordan does in fact have daylight savings. My issue however is that there are many websites out there that claim that Jordan has in fact, removed all their daylight savings! Can any body verify for me which of these is correct?
Jordan has daylight savings... Yay, or Nay??
Thanks!
The most accurate, well-maintained, well-researched web site I know of for this is timeanddate.com. They have a specific page regarding Jordan's issues for this year, which says the following:
The Jordanian government recently announced that the country will continue observing daylight saving time (DST) all year for the second year in a row. The local time in Jordan and its capital Amman is 3 hours ahead of Coordinated Universal Time (UTC).
It has additional details, which I suggest you read if this is relevant to you.
The confusion you are probably encountering is because they are on daylight saving time, but they have cancelled any transitions back to standard time, so some may just interpreting that as a new standard time for them.
Joda Time uses the IANA TZDB, which is also very well maintained. Much of the data on timeanddate.com comes from there anyway.
For Jordan, you should have a time zone id of Asia/Amman. The recent changes for Jordan are reflected in version 2013f. Joda Time 2.3 shipped with 2013d, so you'll need to manually update to the latest data version following the instructions here.
If you'd like to see the specific changes made to the TZDB for Jordan in 2013, you can find them in this commit in the unofficial sources.
Related
The client wants to see windows timezones, the ones at Time column here https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values except with UTC instead of GMT.
And also wants to see abbreviations. But I can't find any official windows timezones abbreviation list. What I find is IANA abbreviations.
We are goin to convert windows timezones to IANA timezones to work with time.
But the question is does IANA abbreviations=Windows timezones abbreviations?
If not where can I find the list of the rule for the windows abbreviations?
A few things:
The list you pointed at is not the official list of Microsoft Windows time zones. It is a copy of a very old static list from Windows Embedded 1.1., which has long been deprecated. There presently is no actively maintained list of all Windows time zones on a Microsoft web page.
To get a list of Windows time zones, call TZUTIL /L on the command line. It will return the ID and display name of each time zone installed on the system.
If you look at the CLDR zone mapping file, you'll see that many Windows zones map to more than one IANA zone. If you simply map the Windows zone to the 001 "golden zone", you may end up picking an IANA abbreviation that doesn't apply for the user. Thus, if you take the approach you described (converting to IANA and taking the IANA abbreviation), be sure to take the country code into consideration as well when doing the mapping.
Also:
There is no official single list of time zone abbreviations anywhere, because time zone abbreviations are not standardized. Many of the abbreviations we might use in English don't necessarily apply to non-English speakers, and many time zones don't have abbreviations at all.
Even in English, many time zone abbreviations are contradictory or ambiguous.
Some examples of problematic time zone abbreviations:
Does CST mean Central Standard Time, Cuba Standard Time, or China Standard Time?
Does IST mean India Standard Time, Israel Standard Time, or Ireland Standard Time?
Should Hawaii use HST or HAST?
Should HNE (Heure Normale de l'Est) be used instead of EST (Eastern Standard Time) in Quebec, Canada since its official language is French?
What is the time zone abbreviation of Minsk, Belarus? You might think MSK, but that's offensive to some because that abbreviation is also commonly used for Moscow, Russia. Belarus has one time zone for the whole country, and they don't speak English there. IANA gives the abbreviation as simply the numeric UTC offset +03 (since mid 2011).
Because of the above problems...
There is no official list of time zone abbreviations for Windows time zones. Windows doesn't use them.
You might find some time zone abbreviations listed in CLDR data, and exposed with various libraries and APIs, but they only sparsely populated in the data set. CLDR has not been reliably collecting or maintaining time zone abbreviations.
I'm wondering if anyone else is seeing an issue with specific time zone abbreviations in their Rails apps on Ubuntu 12.0.4 boxes with tzdata 2016j.
For Asia/Yerevan, Asia/Istanbul, and Asia/Baku I seem to be getting incorrect Time Zone abbreviations - Time.now.in_time_zone will display the time with zone abbreviations: +04, +03, +04 when running the app on Ubuntu 12.0.4, whereas on my Mac (OS X El Capitan), I'm seeing AMT, EET, and AZT respectively (looks like Istanbul is getting incorrect time zone there).
If you're on any other version of Ubuntu or tzdata, I'd also appreciate any insight into what time zone abbreviations you get for these zones. I'm still trying to figure out which part of the stack is causing the issue.
Also, if anyone has a workaround, I'd greatly appreciate any insight there as well.
The source data itself has been changed. Over the last several releases, the TZ maintainers have been removing abbreviations that were previously invented or otherwise unsubstantiated.
The fact of the matter is that the idea of a "time zone abbreviation" is not a universal concept. We'd like to think that everyone around the world uses them, but really they don't. And when they do, they do not necessarily mean the same things as we think they do, or are the chosen abbreviations used universally. For example, A person in Minsk might happen to use the same UTC offset as a person in Moscow, but Moscow's use of MSK is well-known. Applying it to Minsk could be taken as an insult. Indeed, the TZDB used to use MSK for "Minsk Time", until this recent set of changes started.
It gets even more complicated when you think about abbreviations in other langugages.
If you have documentation to show that an abbreviation is actually used by those who live in the place in question (i.e., do people in Baku actually say "AZT"), then please present your findings on the discussion mailing list at IANA.
If you're just trying to get back what you had before - you'll have to make a list of your own "invented" abbreviations and refer to that. The TZDB is clear that it no longer wants to be the source of misinformation.
The better option, IMHO, is just to avoid using time zone abbreviations at all.
As described in the timezone tag wiki, there are two different styles of time zones.
Those provided by Microsoft for use with Windows and the .Net TimeZoneInfo class (when running on Windows) are identified by a value such as "Eastern Standard Time".
Those provided by IANA in the TZDB, and used by the .NET TimeZoneInfo class when running on Linux or OSX, are identified by a value such as "America/New_York".
Many Internet-based APIs use the IANA time zones, but for numerous reasons one might need to convert this to a Windows time zone id, or vice-versa.
How can this be accomplished in .Net?
Current Status:
Starting with .NET 6, both forms of time zones are supported on any platform that has both time zone data and ICU installed, which is most installations of Windows, Linux, and MacOS. See Tobias's answer.
Original Answer:
The primary source of the data for conversion between Windows and IANA time zone identifiers is the windowsZones.xml file, distributed as part of the Unicode CLDR project. The latest dev version can be found here.
However, CLDR is released only twice annually. This, along with the periodic cadence of Windows updates, and the irregular updates of the IANA time zone database, makes it complicated to just use the CLDR data directly. Keep in mind that time zone changes themselves are made at the whim of the world's various governments, and not all changes are made with sufficient notice to make it into these release cycles before their respective effective dates.
There are a few other edge cases that need to be handled that are not covered strictly by the CLDR, and new ones pop up from time to time. Therefore, I've encapsulated the complexity of the solution into the TimeZoneConverter micro-library, which can be installed from Nuget.
Using this library is simple. Here are some examples of conversion:
string tz = TZConvert.IanaToWindows("America/New_York");
// Result: "Eastern Standard Time"
string tz = TZConvert.WindowsToIana("Eastern Standard Time");
// result: "America/New_York"
string tz = TZConvert.WindowsToIana("Eastern Standard Time", "CA");
// result: "America/Toronto"
There are more examples on the project site.
It's important to recognize that while an IANA time zone can be mapped to a single Windows time zone, the reverse is not true. A single Windows time zone might be mapped to more than one IANA time zone. This can be seen in the above examples, where Eastern Standard Time is mapped to both America/New_York, and to America/Toronto. TimeZoneConverter will deliver the one that CLDR marks with "001", known as the "golden zone", unless you specifically provide a country code and there's a match for a different zone in that country.
Note: This answer has evolved over the years, so comments below may or may not apply to the current revision. Review the edit history for details. Thanks.
Starting with .NET 6, it is finally possible to work with time zones in a cross-platform manner, so these manual workarounds are no longer needed.
The TimeZoneInfo.FindSystemTimeZoneById(string) method automatically accepts either Windows or IANA time zones on either platform and converts them if needed.
// Both of these will now work on any supported OS where ICU and time zone data are available.
TimeZoneInfo tzi1 = TimeZoneInfo.FindSystemTimeZoneById("AUS Eastern Standard Time");
TimeZoneInfo tzi2 = TimeZoneInfo.FindSystemTimeZoneById("Australia/Sydney");
Note that, as specified on the link, the .NET Core Alpine Linux-based Docker images do not have the necessary tzdata installed by default, so it must be installed in your Dockerfile for this to work correctly.
I know this is an old question, but I had a use case I though I would share here, since this is the most relevant post I found when searching. I was developing a .NET Core app using a docker linux container, but for deployment on a windows server. So I only needed my docker linux container to support the windows timezone names. I got this working without changing my application code by doing the following:
cp /usr/share/zoneinfo/America/Chicago "/usr/share/zoneinfo/Central Standard Time"
cp /usr/share/zoneinfo/America/New_York "/usr/share/zoneinfo/Eastern Standard Time"
cp /usr/share/zoneinfo/America/Denver "/usr/share/zoneinfo/Mountain Standard Time"
cp /usr/share/zoneinfo/America/Los_Angeles "/usr/share/zoneinfo/Pacific Standard Time"
Then, in my .NET code, the following worked without any modification: TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time")
I noticed that android makes available a timezone for "US/Michigan". However, I can't find out what that actually is. It looks like most of Michigan is in Eastern and observes DST, and a small part of the UP is in Central and also observes DST. So why did android give them their own timezone, and why can't I find anything on the internet referencing Michigan having it's own time zone? Is this some sort of historical thing for the small number of years in the 70's that Michigan didn't observe DST?
This isn't related to Android specifically, but rather to the identifiers used by the IANA TZ Database, which you can read about in the timezone tag wiki, or on Wikipedia. Android is just one consumer of this data.
You can review the details of the time zones here, and you'll find that "US/Michigan" is an alias for "America/Detroit". This covers the parts of Michigan that are in the Eastern time zone.
You'll also find that Michigan has a second time zone, which is "America/Menominee", which covers the parts of Michigan that are in the Central time zone.
In general, you should use one of these two values rather than the "US/Michigan" alias. Also, if you don't care about historical time zone differences, then it would be acceptable to just use "America/Chicago" for Central time, and "America/New_York" for Eastern time.
The specific history of Michigan, including commentary, can be found in the source files of the TZ database itself. Specifically, it describes that Michigan didn't observe daylight saving time from 1968 to 1973, and that several counties switched from Eastern Time to Central Time in 1973. There are some other minor historical details as well.
I've searched and found a couple of online web services that do this, but I was wondering it there's a database in the public domain which gives a list of latitudes and longitudes for the standard time zone lines? I'd like to be able to calculate what time zone a coordinate is without using a web service. I figured that time zone boundaries are mostly static and were probably decided by some committee, so there should be a CSV or GPX or KML somewhere.
I'd like to be able to check what time zone a coordinate lies in, for example:
48.856667 2.350833 is GMT+1 or CET
This is a series of files -- timezone polygons (shapefile), which you can transform into boundaries. With work on your part.
http://efele.net/maps/tz/world/
You should note that simply knowing the TZ does not guarantee that you know anything about the current correct time or date there in terms of the local calendar. Time Ex: The Isreali Knesset (parliament) decides when Daylight time starts and ends - sometimes they have chosen a date in the past. Date Ex: The Hijri Calendar changes months based on the ability of people in Mecca to actually observe the new moon from there. Cloudy days alter the date.
Askgeo.com has a Java library under commercial license. (Scroll down their page to find information about it). They charge 2 grand up front for it though, considering the amount of work they must have put in compiling loads of vector maps, etc, I can understand they want the money.
I use their free API, but you wanted something downloadable, and I think this is one of your few bets.
I tried openstreetmap and they have the data, but it would be buried in a map of Earth, not completely useful itself. Here is one on Wikipedia though: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
I recently found this data here:
https://github.com/straup/whereonearth-timezone