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 the time zone in linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article is about how to view and modify the time zone in linux. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.

View and modify the time zone of Linux

1. View current time zone

Command: "date-R"

two。 Modify the setting of Linux server time zone

Method A

Command: "tzselect"

Method B is limited to RedHat Linux and CentOS

Command: "timeconfig"

Method C is suitable for Debian.

Command: "dpkg-reconfigure tzdata"

3. Copy the appropriate time zone file, replace the system time zone file, or create a link file

Cp / usr/share/zoneinfo/$ Primary time Zone / $Sub time Zone / etc/localtime

For example: use Asia / Shanghai (+ 8) in setting China time zone

Cp / usr/share/zoneinfo/Asia/Shanghai / etc/localtime

II. Time to view and modify Linux

1. View time and date

Command: "date"

two。 Set time and date

For example: order to set the system date to November 3, 2009

Command: "date-s 11amp 03max 2009"

The command to set the system time to 05:55:55

Command: "date-s 17:55:55"

3. Write the current time and date to BIOS to avoid invalidation after restart

Command: "hwclock-w"

Note:

Date

The current date and time can be seen directly without parameters.

Cal

You can see this month's calendar directly without adding parameters.

The above is how to view the time zone and modify the time zone in linux. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please 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

Servers

Wechat

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

12
Report