Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to view and modify system time in Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article "how to view and modify the system time in Linux" is not quite understood by most people except programmers. Today, in order to make you have a better understanding of "how to view and modify system time in Linux", Xiaobian summed up the following contents, which have a certain reference value, detailed steps are clear, and details are handled properly. I hope you will get something through this article. Next let's take a look at the specific content.

You can use the date command under linux to view the system time:

I use centos7, which is installed in a virtual machine. You can see that the system time of centos7 is different from that of my computer.

You can also modify the system time through the date command

Format is date-s "YYYY-MM-DD hh:mm:ss"

However, after this modification, after restarting the system, the time becomes the time before the modification. This is because we only modified the system time, not the hardware time. Generally speaking, the time we see is the system time, while the hardware time refers to the CMOS time on the motherboard. These two times are not always synchronized. They are usually synchronized at intervals of about 11 minutes.

When the system starts, it reads the time from the CMOS once as the system time, and then the system time is independent.

Synchronize system time to hardware time via hwclock-systohc

All system times can be modified through date-s "YYYY-MM-DD hh:mm:ss" & & hwclock-systohc

Note: after the virtual machine may be restarted, the system time still becomes the host time.

What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.

Thank you for your reading. I hope you have a certain understanding of the key issue of "how to view and modify system time in Linux". The specific usage still needs to be understood by hands-on experiments. Try it quickly. If you want to read more articles about relevant knowledge points, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report