UTC time in Linux vs. windows

Source: Internet
Author: User
Tags local time

Linux and UTC time in Windows introduce a few terms first

UTC coordinates the world, also known as world standard Time or world coordinated time, referred to as UTC (from English "coordinated Universal"/French "Temps universel cordonné"), Is the most important world time standard, which is based on the atomic time of the second, at the moment as close as possible to Greenwich normal.

GMT Greenwich Mean Time (Chinese translation: GMT or GMT, Taiwan, Hong Kong, Australia translation: GMT; English: Greenwich Mean time, GMT) refers to the standard time of the Royal Green Wedge Observatory, located in the outskirts of London, as the Prime meridian is defined through the meridians there.

localtime The local clock, which is the current time of the local time zone.

In simple sense, UTC time is equivalent to GMT time.

The operating system uses two clocks to save time: hardware clock and system clock.

  • The hardware clock (i.e. real-time clock RTC or CMOS clock) can only be saved: years, months, days, hours, minutes, seconds, these time values, cannot save the time standard (UTC or localtime) and whether to use daylight saving adjustment.
  • The system clock (i.e. software time) is maintained separately from the hardware time, with the time, time zone, and daylight saving settings. The Linux kernel is saved as the number of seconds elapsed from January 1, 1970 UTC time. The initial system clock is calculated from the hardware time and the/etc/adjtime settings are taken into account when calculating. After the system is booted, the system clock runs independently from the hardware clock, and Linux maintains the system clock with a clock interrupt count.

The hardware clock is the time recorded in the BIOS.
For Windows systems, the hardware clock in the BIOS is treated as localtime by default, and when the system shuts down, Windows synchronizes the time to hardware time, so the BIOS clock and the system clock become localtime.

For Linux systems, such as the Red Hat system, there will be an option at the time of installation at System Clock uses UTC, when this option is checked, indicating that the system treats the BIOS hardware clock as UTC time, As a result, the system clock is calculated using the time zone and daylight savings of the BIOS. If this option is not checked, the system treats the BIOS hardware clock as localtime, and the system synchronizes the hardware clock directly to the system clock without time zone calculations. When the Linux system is powered off, this is an example of Red Hat, which, when powered off, uses the/etc/rc.d/init.d/halt script to determine if the system is using UTC hardware time, and if UTC time is used, This converts the system clock localtime to UTC to the hardware clock, and if no UTC time is used, synchronizes the system clock directly to the hardware clock, and the system is enabled to set the UTC hardware Clock in/etc/sysconfig/clock.

When Linux and Windows systems coexist

If you have a Windows operating system installed, it is a good idea to set WinDOS to the UTC hardware clock by modifying the registry. In this way the Linux system can also use the UTC clock, the advantage of using the UTC clock is that the system automatically sets the system clock based on the time zone and daylight savings. If Windows is to use LocalTime, then Linux is best to turn off UTC with LocalTime. If the Linux system and the Windows system use different settings (that is, the default settings are used), the system will synchronize the hardware clock when shutting down, the result is the hardware clock has been changed to change, not Windows 8 hours, that is, Linux faster 8 hours.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.