ใน CentOS 7 มีเครื่องมือใช้ในการตั้งค่า timezone และค่าเกี่ยวกับเวลาต่างๆ ได้ด้วยคำสั่ง timedatectl
ตัวคำสั่งรองรับพารามิเตอร์ดังนี้
[root@localhost ~]# timedatectl --help
timedatectl [OPTIONS...] COMMAND ...
Query or change system time and date settings.
-h --help Show this help
--version Show package version
--adjust-system-clock
Adjust system clock when changing local RTC mode
--no-pager Do not pipe output into a pager
-P --privileged Acquire privileges before execution
--no-ask-password Do not prompt for password
-H --host=[USER@]HOST Operate on remote host
Commands:
status Show current time settings
set-time TIME Set system time
set-timezone ZONE Set system timezone
list-timezones Show known timezones
set-local-rtc BOOL Control whether RTC is in local time
set-ntp BOOL Control whether NTP is enabled
แสดงเวลาและการตั้งค่าเกี่ยวกับเวลาปัจจุบัน
timedatectl
แสดงรายชื่อ timezone ที่รองรับ
timedatectl list-timezones
ตั้งค่าวันที่
timedatectl set-time 2014-10-01
ตั้งค่าเวลา
timedatectl set-time 00:16:34
ตั้งค่า timezone
timedatectl set-timezone Asia/Bangkok
ตั้งค่าให้นาฬิกาไบออสเป็นเวลาเครื่องด้วย
timedatectl set-local-rtc 1
ตั้งค่าให้ synchronize เวลาผ่าน ntp
timedatectl set-ntp 1
คำเตือน เนื้อหาต่างๆ ในบทความ รวมถึงรูปภาพทั้งหมดในบทความนี้ เป็นความเห็นส่วนตัวของผู้เขียนแต่ละคน ซึ่งแต่ละคนได้ทำการลงทะเบียน และเขียนบทความลงใน Modoeye Articles นี้โดยไม่มีค่าธรรมเนียมใดๆ บทความเหล่านี้เป้าหมายเพื่อการศึกษา และความบันเทิงเท่านั้น การนำส่วนหนึ่งส่วนใดของบทความไปใช้งาน ควรทำการอ้างอิงถึงผู้เขียนและแหล่งที่มาด้วย