Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Linux modify the system time     - Linux cron job (Linux)

- To learn from scratch OpenWrt perfect tutorial (Linux)

- Install and use automated tools Ansible in CentOS 7 (Linux)

- MySQL 5.6 use GTIDs build the master database (Database)

- Ubuntu 12.04 installation instructions under GAMIT10.40 (Linux)

- Linux command line to put on your coat GUI (Linux)

- Linux directory permissions to read and execute permissions difference (Linux)

- Additional SQL Server 5123 database reported error (Database)

- Why did not Oracle privileges can also log in with sysdba (Database)

- CentOS 6.5 using Virtualenv under development environment to build Python3 (Linux)

- CentOS 6.4 Telecom ADSL dial-up network configuration (Linux)

- Android judgment toward camera pictures (Programming)

- How to install and configure a VNC server on CentOS 7.0 (Server)

- NGINX Plus now fully supports HTTP / 2 (Server)

- CentOS6.x and Windows XP and Windows Server 2003 Open IPv6 related matters (Linux)

- CentOS 6.5 install Maven and Nexus warehouse agent (Server)

- Ubuntu 15.10 under Python + Apache + CGI fully configured (Server)

- Python 3.5 await / async (Programming)

- Vmstat command Linux Performance Monitoring (Linux)

- CentOS installation pycurl (Linux)

  Linux modify the system time
  Add Date : 2018-11-21      
  Linux Detailed modify the system time


(1) date 042612492005

(2) hwclock -w

The first step is to set the mean time, you can view the set finished with the date command right ... note the month, day, hour Year

The second step is to write the meaning of the motherboard rtc chip ..


su -c 'date -s month / day / year'

su -c 'when the date -s: minutes: seconds'


Learn Linux clock

Because Linux and Windows Clock clock from the classification concept, the use of the set are very different, so find out ways of working with Linux clock setting operation, not only of great significance for Linux beginners, but also for the use of Linux server users. it is particularly important.

Classification Linux clock


We may be very familiar with the clock, Linux clock is conceptually similar to the Windows clock displays the current system time, but the clock was set and the classification and Windows different. And the difference is Windows, Linux into the clock system clock (System Clock) and hardware (Real Time Clock, referred to as RTC) clock two kinds. The system time is the current Linux Kernel clock and the hardware clock on the motherboard is powered by a battery of the motherboard hardware clock, the clock can be set in the BIOS "Standard BIOS Feture" item.

Since Linux has two clock systems, then Linux you are using the default clock system which use it? We will not return to the case of the two systems clock conflict happen? These questions and worried. First, Linux and no default system clock. When Linux boots, to read the hardware clock system clock setting, and then the system clock will be independent of the hardware operations.

From the Linux boot process, the system clock and the hardware clock does not conflict, but all Linux commands (including function) are based on the system clock settings. Moreover, the system clock and the hardware clock can also use asynchronous mode, as shown in Figure 1, the system time and hardware time may be different. This has the advantage of little significance for the average user, but for Linux network administrator there is very useful. For example, to a large network (across several time zones) server synchronization, if located in New York and Beijing Linux server Linux servers, one of the servers without having to change the hardware clock and set up a temporary system time only, such as synchronized time setting on the server to Beijing to New York time, two servers to complete the file, and then click to sync with the original clock. Such systems and hardware clock provides a more flexible operation.

Setting up Linux clock

Linux, the clock command to view and set the main date, hwclock, and clock. Wherein, clock and hwclock usage is similar, except that in addition to support for x86 hardware clock command system, also supports Alpha hardware system. Since the vast majority of users use the x86 hardware architecture, it is possible depending on these two commands to a command to learn.

1. Use the date command in a virtual terminal to view and set the system time

Check the operation of the system clock:

# Date

Set the system clock operation:

# Date 091713272015.30

General format:

# Date Month Day Year midnight. Seconds

2. Use the clock or hwclock command to view and set the hardware clock

Check the hardware clock operation:

# Hwclock --show or

# Clock --show

September 17, 2015 Wednesday 13:24:11 -0.482735 seconds

Set the hardware clock operation:

# Hwclock --set --date = "09/17/2015 13:26:00"


# Clock --set --date = "09/17/2015 13:26:00"

General format: hwclock / clock --set --date = "month / day / year hours: minutes: seconds."

3. To synchronize the system clock and the hardware clock

Linux system (I use the Red Hat 8.0, other systems have not done experiments) default after restart, hardware clock and system clock synchronization. If it was not convenient, then restart (reboot the server usually less), use the clock or hwclock command to synchronize the system clock and the hardware clock.

Hardware clock and system clock synchronization:

# Hwclock --hctosys


# Clock --hctosys

The above command, - hctosys represents Hardware Clock to SYStem clock.

System clock and the hardware clock synchronization:

# Hwclock --systohc


# Clock --systohc
- Java NIO in the world (Programming)
- Share and show your code on GitHub (Linux)
- Install the system cleaning software under Linux: BleachBit 1.4 (Linux)
- Let Git variety of colors and custom log format output (Linux)
- Linux file time Comments ctime mtime atime (Linux)
- Linux installation notes under GAMIT (Linux)
- When the master key encounter NULL (Database)
- C ++ 11 feature: auto keyword (Programming)
- How to identify memory leaks in Java (Programming)
- Java factory pattern (Factory mode) (Programming)
- To use Linux to create a secure managed gateway (Linux)
- Examples of Python any parameters (Programming)
- Using C / C ++ extensions Python (Programming)
- Number JavaScript type system (Programming)
- Linux package manager - yum (Linux)
- GitLab Installation Guide -Ubuntu 14.04 LTS (Server)
- Linux development management utility command (Linux)
- Story timestamp and time zones: daily programmer (Programming)
- After the first remote installation GlassFish Web to remotely access their back office management system error solution appears (Server)
- The best tools and techniques to find data on a Unix system (Linux)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.