The following code converts the current local time to UTC and displays the result to the console: DateTime dateNow = DateTime.Now Ĭonsole.WriteLine("The date and time are. Returns the dateTime parameter unchanged. The exact conversion performed by the method depends on the value of the dateTime parameter's Kind property, as the following table shows: DateTime.KindĪssumes the dateTime parameter is local time and converts local time to UTC. The easiest way to convert a time to UTC is to call the static ( Shared in Visual Basic) TimeZoneInfo.ConvertTimeToUtc(DateTime) method. Because DateTimeOffset objects store a date and time value along with its offset from UTC, they always represent a particular point in time in relation to UTC. You can also serialize a DateTimeOffset structure to represent a single point in time unambiguously. Converting individual time zones to UTC makes time comparisons easy. For details and other best practices using dates and times, see Coding best practices using DateTime in the. The use of UTC is recommended when a date and time's portability across computers is important. Thus, UTC provides a time-zone free or time-zone neutral time. The world's time zones are expressed as positive or negative offsets from UTC. Converting to Coordinated Universal TimeĬoordinated Universal Time (UTC) is a high-precision, atomic time standard. This article explains how to convert times from one time zone to another and convert DateTimeOffset values that have limited time zone awareness. For example, a web page that displays the current time in the eastern part of the United States will lack credibility to a customer in eastern Asia. An application can no longer assume that all times can be expressed in the local time, which is the time available from the DateTime structure. Today, Greenwich Mean Time (GMT) is only the name of a time zone that is used by a few countries in Africa and Western Europe, including the UK during winter and all year in Iceland.It's becoming increasingly important for any application that works with dates and times to handle differences between time zones. Since then, GMT is no longer a time standard. Until 1972, Greenwich Mean Time (also known as Zulu time) was the same as Universal Time (UT). UTC was adjusted several times until 1972, when leap seconds were introduced to keep UTC in line with the Earth's rotation, which is not entirely even, and less exact than atomic clocks. The name Coordinated Universal Time was officially adopted in 1967. In 1960, the International Radio Consultative Committee formalized the concept of UTC, and it was put into practice the year after. The transit circle is a part of the telescope's mechanics and it is still cited as the prime meridian's original reference (0° longitude). The reference line or starting point, the Prime Meridian, was determined to be the transit circle at the Royal Observatory in Greenwich, London. This is the basis for the 24-hour time zone system we know today.Īt the time, Greenwich Mean Time (GMT) was chosen as the world’s time standard. Universal Time (UT) was created at the International Meridian Conference in 1884. It is used to compare the pace provided by TAI with the actual length of a day on Earth. Universal Time (UT1): Also known as astronomical time or solar time, it refers to the Earth's rotation.International Atomic Time (TAI): A time scale that combines the output of some 400 highly precise atomic clocks worldwide, and provides the exact speed for our clocks to tick.Two components are used to determine UTC: The world's timing centers have agreed to keep their time scales closely synchronized - or coordinated - therefore the name Coordinated Universal Time. UTC is the time standard commonly used across the world. ©/stocknshares A Standard, Not a Time Zone The Greenwich Meridian in London, England.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |