![]() (If you want to learn more details, I am sure you will enjoy The History of Daylight Saving Time.) From 1945 to 1966, time zones were an absolute pandemonium as states and localities were allowed to choose whether and when they observed DST. ![]() went on continuous daylight saving time (DST). and more countries followed for the duration of World War I. Britain thought it was a good idea, and copied it the U.S. This would “save daylight,” so less energy would have to be allocated to artificial lighting – all the more for the war effort. This is nice and makes perfect sense, right? But wait! There’s more! Because Daylight Saving Time makes the time-and-date calculations even more complex.ĭuring the First World War, Germany decided that clocks should be moved forward so that the sun would effectively set one hour later. It is now possible to know what time it is, right now, anywhere in the world, as long as you know what time zone covers that location. China even set a single time zone for the whole country. Large countries modified it slightly so that time zones followed political boundaries rather than strict meridians. By 1920, it was generally adopted the world over. In October 1884, the international 24-hour time zone system, with the Greenwich Mean Time (GMT) as its prime meridian, was first adopted by a few countries. Some countries set up their own standards (which may remind you of the computer industry’s own “any standard as long as it’s mine” history). But as civilization expanded, and communications and travel became faster and more commonplace, standards had to be established. Once, timekeeping was a very local affair, using shadow clocks and sundials, so a particular reading of the time was valid only at a specific location. To use any other calendar, you must use an external library such as Joda Time.ĭate and time measurement is surprisingly complex. The Java Core Classes also support the Japanese Imperial calendar and the Buddhist one, but only inasmuch as it calculates the years according to the “start of eras” of those calendars. Today, the Gregorian calendar is usually the only calendar your software applications have to worry about, fortunately. ![]() The last European countries to adopt it did so in 1923. This Julian calendar was used in most of Europe and its early colonies until it was replaced by the Gregorian calendar, starting in 1582. In 46 BC, Julius Caesar introduced the calendar that would be named after him. The Mayans, Greeks, Celts, Asians, Hindu, each had their own calendars. Once upon a time, the ancient Sumerians recorded the passing of days and years using a 12-month calendar. Java’s core time classes can handle some of the confusion, particularly from Java7 on, but JodaTime offers a richer and more versatile way of coping with these issues that is also compatible with earlier Java versions. How can you “add a day” to a timestamp when a day can be 23 hours long? What seems like a simple task, such as “record when a change was made” turns into a nightmare when you have to account for time zones and daylight saving. Date and time manipulations are one of the hardest things to do right when programming for a global user base.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |