CentOS / RHEL 7 更改时区
timedatectl 是 RHEL7 上的一项新功能。它可用于查询和更改系统时钟及其设置。
按照以下步骤将时区更改为中国。(以root用户身份执行以下命令)。
1.使用以下命令列出所有可用的时区。你将使用此命令获得一长串时区。
# timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
....
2.找到中国时区中所需的正确时区并设置特定时区。有一个名为 tzselect 的命令可以帮助您找到所需的时区。例如,要在中国查找时区,请按如下所示使用它:
# tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
) Africa
) Americas
) Antarctica
) Arctic Ocean
) Asia
) Atlantic Ocean
) Australia
) Europe
) Indian Ocean
) Pacific Ocean
) none - I want to specify the time zone using the Posix TZ format.
#?
Please select a country.
) Afghanistan ) Israel ) Palestine
) Armenia ) Japan ) Philippines
) Azerbaijan ) Jordan ) Qatar
) Bahrain ) Kazakhstan ) Russia
) Bangladesh ) Korea (North) ) Saudi Arabia
) Bhutan ) Korea (South) ) Singapore
) Brunei ) Kuwait ) Sri Lanka
) Cambodia ) Kyrgyzstan ) Syria
) China ) Laos ) Taiwan
) Cyprus ) Lebanon ) Tajikistan
) East Timor ) Macau ) Thailand
) Georgia ) Malaysia ) Turkmenistan
) Hong Kong ) Mongolia ) United Arab Emirates
) India ) Myanmar (Burma) ) Uzbekistan
) Indonesia ) Nepal ) Vietnam
) Iran ) Oman ) Yemen
) Iraq ) Pakistan
#?
Please select one of the following time zone regions.
1) Beijing Time
2) Xinjiang Time
#? 1
The following information has been given:
China
Beijing Time
Therefore TZ='Asia/Shanghai' will be used.
Local time is now: Thu Aug 22 16:57:30 CST 2019.
Universal Time is now: Thu Aug 22 08:57:30 UTC 2019.
Is the above information OK?
1) Yes
2) No
#? 1
You can make this change permanent for yourself by appending the line
TZ='Asia/Shanghai'; export TZ
to the file '.profile' in your home directory; then log out and log in again.
Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Shanghai
# timedatectl set-timezone Asia/Kolkata
3. 运行 “date” 命令查看时间是否正确
# date
Thu Aug :: CST
您还可以使用 timedatectl status 命令检查详细状态。
# timedatectl status
Local time: Thu -- :: CST
Universal time: Thu -- :: UTC
RTC time: Thu -- ::
Time zone: Asia/Shanghai (CST, +)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
CentOS / RHEL 7 更改时区的更多相关文章
- [转帖]如何重置CentOS/RHEL 7中遗忘的根用户帐户密码
如何重置CentOS/RHEL 7中遗忘的根用户帐户密码 https://www.cnblogs.com/swordxia/p/4389466.html 作者的blog质量很高呢 没看完 但是感觉 很 ...
- Linux 更改时区
原文:https://www.cnblogs.com/st-jun/p/7737188.html Linux修改时区的正确方法 CentOS和Ubuntu的时区文件是/etc/localtime,但是 ...
- 【Linux笔记】CentOS&RHEL YUM基础知识
以下内容收集自网络,以作参考. 一.YUM是什么 YUM = Yellow dog Updater, Modified. 主要功能是更方便的添加/删除/更新RPM包. 它能自动解决包的倚赖性问题. 它 ...
- 【Linux】YUM Repositories for CentOS, RHEL & Fedora Systems
这里是官方wiki:https://wiki.centos.org/AdditionalResources/Repositories 一.简介 YUM(Yellowdog Updater Modifi ...
- 如何在CentOS/RHEL & Fedora上安装MongoDB 3.2
MongoDB(名称取自"huMONGOus")是一个有着全面灵活的索引支持和丰富的查询的数据库.MongoDB通过GridFS提供强大的媒体存储.点击这里获取MongoDB的更多 ...
- PHP 5.4 on CentOS/RHEL 6.4 and 5.9 via Yum
PHP 5.4 on CentOS/RHEL 6.4 and 5.9 via Yum PHP 5.4.16 has been released on PHP.net on 6th June 2013, ...
- [转载]PHP 5.6 on CentOS/RHEL 7.0 and 6.6 via Yum
https://webtatic.com/packages/php56/ PHP 5.6.5 has been released on PHP.net on 22nd January 2014, an ...
- 通过yum升级CentOS/RHEL最小化安装
1.如果你有安装CentOS / RHEL最小服务器安装,您可能有很多麻烦没有安装包 2.有一种方法来安装所有的包,需要一个基本的服务器,使用yum groupinstall命令 3.从最小的安装基本 ...
- 在CentOS/RHEL 6.5上安装Chromium 谷歌浏览器
之前Google就说了,由于CentOS/RHEL 6已经是过期的系统,所以不再会有Chrome了. 虽然后来由于引起了社区的抗议,从而改口,不再提CentOS/RHEL 6是过期系统了:但是,目前在 ...
随机推荐
- UniChat-软件工程小组-第一次作业-选题
软件工程小组项目文档 小组成员:赵有为.张天善.宋春雨.郭凯璐.孙楠.冯韵瑶 Uni-Chat项目文档 需求分析Need 日常生活中我们在使用Ubuntu等系统时都会因为QQ等聊天工具对基于Lin ...
- 2013.6.24 - OpenNE第四天
今天晚上跟师兄讨论,这那几篇论文,对于<领域多词表 达翻译对的自动抽取及其应用>那篇,我的感觉是跟实体识别不太吻合.他的大概意思就是先讲所有有可能的多词表达都找出来,然后在用C-value ...
- JVM参数优化(基础篇)
原文:https://www.howardliu.cn/java/jvm-tuning-basic/ 这几天压测预生产环境,发现TPS各种不稳.因为是重构的系统,据说原来的系统在高并发的时候一点问题没 ...
- python高级特性-迭代器
凡是可作用于for循环的对象都是Iterable类型: 凡是可作用于next()函数的对象都是Iterator类型,它们表示一个惰性计算的序列: 集合数据类型如list.dict.str等是Itera ...
- mysql 杂记 —— 时区问题
查看时区: SHOW VARIABLES LIKE "%time_zone%"; 输出 Variable_name Value system_time_zone CST time_ ...
- sql:拼接字符串、截取字符串、取字符串长度
--第一段 SELECT substr('1233***6795', 0, (select instr('1233***6795', '***', 1, 1) from dual) - 1) from ...
- 图表可视化highcharts和百度的echarts
前端数据可视化插件有很多,有 Highcharts(https://www.hcharts.cn/) Echarts(http://echarts.baidu.com/) D3(https://d3j ...
- 向指定URL发送GET和POST请求
package com.sinosoft.ap.wj.common.util; import java.io.BufferedReader;import java.io.IOException;imp ...
- Spring框架的核心功能之AOP技术
技术分析之Spring框架的核心功能之AOP技术 AOP的概述 1. 什么是AOP的技术? * 在软件业,AOP为Aspect Oriented Programming的 ...
- python - django (创建到运行流程)
a = 0 """ 1. 创建 Django 操作文件 a. cmd 中选择路径: cd C:\Users\ad\PycharmProjects\index\1\文件名 ...