9.5 Time Zone

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

local time

Local time is the current time in a local time zone. It is designated using the number of hours ahead or behind UTC time. For example the local time for the Mountain Time Zone in the United States is UTC -7. The default setting for several hardware clocks in a system BIOS is often local time.

/etc/sysconfig/clock

See the current time zone. The file shows the following line: ZONE=timezone

TZ=time_zone export TZ

Change the time zone environment variable. Use the file names in the /usr/share/zoneinfo directory to see the appropriate names for time zones. Note: Environment variable changes are only permanent if they are added to a shell configuration file similar to ~/.bashrc or ~/bash_profile.

tzselect

Change the value of the time zone (TZ) environment variable. When executed, the utility prompts you to select a region, then a country, and so on until it has enough information to determine the time zone. Only the root user can invoke the tzselect utility. Note: Use the tzconfig command on Debian Linux distributions in place of tzselect. To use tzselect: Type tzselect and press Enter. Type the number from the list that corresponds to the correct continent or ocean, and press Enter. Type the number from the list that corresponds to the correct region, and press Enter. Type the number from the list that corresponds to the correct timezone, and press Enter. Press 1 to confirm the setting.

Coordinated Universal Time (UTC)

Coordinated Universal Time (UTC), formerly known as Greenwich Mean Time (GMT), is a method of identifying a common time between devices regardless of their physical location in the world. UTC is adjusted periodically to match the rotation of the earth by adding leap seconds. Leap seconds are required because the official duration of a second does not exactly match the earth's rotation (but is very close). UTC matches time to the rotation of the earth using a single fixed point in Greenwich, England. A line drawn from north pole to south pole that passes through Greenwich is called the prime meridian. Most computers use UTC (not local time) when recording timestamps. This ensures that a single method of keeping time is used, regardless of the physical location of the computer. Time expressed using UTC is identified by adding UTC or Z to the time. For example, 09:30 UTC is the same as 09:30Z or 0930Z. UTC is also called Zulu time.

UTC offset

The UTC offset identifies the amount of time that local time is ahead of or behind Coordinated Universal Time (UTC). Local time in each time zone is identified by the UTC offset. For example: Time zones used in the United States are UTC-05 (Eastern), UTC-06 (Central), UTC-07 (Mountain), and UTC-08 (Pacific), with time being behind UTC. Time zones used in Europe and Asia are ahead of UTC. For example, time in Germany is UTC+01, and time in Japan is UTC+09. To convert UTC to local time, add time based on the UTC offset (UTC + offset). For example, if UTC is 06:00: Local time in New York (UTC-05) would be 01:00 (06:00 + - 5:00 = 1 am). Local time in Los Angeles (UTC-08) would be 22:00 the previous day (10 pm). Local time in Japan (UTC+09) would be 15:00 (3 pm). To convert local time to UTC, subtract time based on the UTC offset (UTC - offset). For example: If the local time in New York (UTC-05) is 14:00, UTC is 19:00 (14:00 - - 5:00 = 14:00 + 5:00). If the local time in Japan (UTC+09) is 14:00, UTC is 5:00 (14:00 - + 9:00). UTC does not change for daylight savings time; however, the offset used by a time zone will change. During daylight savings time, add one hour to the UTC offset. For example: Standard time in New York is UTC-05; daylight time in New York is UTC-04. Standard time in Germany is UTC+01; daylight time in Germany is UTC+02.

/proc/driver/rtc

The current hardware clock time is stored here

date

To view and manually set the system time. shows the current local time and the time zone.

/usr/share/zoneinfo

View the set of time zone configuration files and directories, with each file identifying a specific time zone. Files are typically organized in subfolders based on continent (such as Australia) or major country (such as US). Individual files identify a major city in the time zone (such as Perth) or a specific region (either a division of the country or a country within the continent). Information in the file identifies the UTC offset and any rules for daylight savings time. Depending on the distribution, time zone files might be located at /usr/lib/zoneinfo.

Hardware clock

a clock that is maintained by hardware. The hardware clock runs independently of any program. The clock does not require the CPU or memory to run. Soft power from the power supply and the CMOS battery ensures that the clock continues to run even when the computer is turned off. The hardware clock is sometimes called the real time clock (RTC), BIOS clock, CMOS clock, or time of year (TOY) clock.

cp -s /usr/share/zoneinfo/time_zone_file /etc/localtime

accomplishes the same result as the example above.

ln -s /usr/share/zoneinfo/time_zone_file /etc/localtime

creates a symbolic link to the time zone file that permanently alters the time zone for the current user account.

ls /usr/share/zoneinfo

displays the names for time zones that Linux uses. Additional settings are located in the subdirectories.

/etc/localtime

file identifies the current time zone file used on the system. This is a symbolic link to a timezone file in the /usr/share/zoneinfo directory. Replacing this link changes the timezone.

/etc/timezone

identifies the current time zone by region and zone.

time System time

is the clock that runs within the operating system. A system clock increments in seconds starting from 12:00 AM on Jan 1, 1970. By default, when the computer boots, it sets the system time based on the hardware clock. After the operating system runs, the system time is the only clock used by applications and services. Changing the system time does not automatically change the hardware clock, although you can change the system time and change the hardware clock to match. The system clock is the clock that Linux uses for all its functions and applications.


Ensembles d'études connexes

Career Explorations Unit 2. The Rise of Modern Medicine

View Set

Ch 4: The Freudian Approach: Relevant Research

View Set

Critical Care Acute Respiratory Failure

View Set

Nursing 330 Exam 3 questions resp/gi/gu

View Set

Chapter 11: Attraction and Intimacy

View Set