小易说IT 小易说IT

Linux 查看时区、时间常用命令

1. 查看系统当前时间(最常用)

date

输出示例:

Tue Oct 20 14:30:25 CST 2026

CST:中国标准时间

2. 查看时区信息

timedatectl

重点看这两行:

Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes

单独只输出时区:

timedatectl show -p Timezone --value

查看时区配置文件

ls -l /etc/localtime

/etc/localtime 是软链接,指向时区数据库文件 /usr/share/zoneinfo/Asia/Shanghai

cat /etc/timezone

Debian/Ubuntu 才有 /etc/timezone,RHEL/CentOS/openEuler 一般没有

3. 查看硬件时间(BIOS/rtc 时间)

hwclock

顺带:设置时区(参考)

timedatectl set-timezone Asia/Shanghai

区分两个时间

  • 系统时间:Linux 内核维护的时间,date

  • 硬件 RTC 时间:主板 CMOS 时钟,hwclock


本文原创作者:易君召,详见:https://www.yijunzhao.cc/about,转载请注明出处。

原文链接 https://www.yijunzhao.cc/archives/linux-check-timezone-time-common-commands

欢迎访问 https://www.yijunzhao.cc/

https://www.yijunzhao.cc/