![]() ![]() It’s a link to America/Denver, and America/Denver does use summer time (daylight saving time, DST). The US/Mountain time zone ID is deprecated. When I ran this code just now, the output was: It’s simple when you know how: ZonedDateTime arizonaExceptNavajo = ZonedDateTime.now(ZoneId.of("America/Phoenix")) They are all poorly designed and fortunately all long outdated. Don’t use the classes Calendar, GregorianCalendar, TimeZone and Date. A timezone named "US/Indiana" (or "America/Indianapolis") was created to cover this region, an even today, you would still want to use the timezone "America/Indianapolis" when talking about Indiana, so that queries about dates and times before 2006 could be answered correctly. While you usually think of the term "time zone" to mean the time of day in the middle of the winter (when everybody observes standard time), in the Olson database a timezone name represents the entire history of daylight savings time rules and timezone rules for a particular region.Īs an example, even though Indiana now observes Eastern time and observes DST (except for a few counties right near Chicago which are on Central time like Chicago), before 2006 they didn't observe DST. To get the correct time in the correct timezone for any given city in the world, you simply have to familiarize yourself with the names in the Olson timezone database and their meanings. To save yourself some of the trouble, always try to use the names from "America/*" where you can pick the name of a city that has the same timezone rules as the place you're interested in. In the Navajo nation, you want the timezone named "Navajo". To get the rules for Arizona (which don't include DST), you want the timezone "US/Arizona" (or "America/Phoenix"). If you specify the timezone "US/Mountain", then the computer will apply the rules used by most states in the Mountain time zone, which include observing daylight savings time. ![]() Arizona is in the Mountain timezone, but doesn't observe DST.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |