Title: Methods for Viewing and Modifying CentOS System Time and Timezone
Tags:
- centos
- VPS
Excerpt: ''
Categories: - Linux
Abbreviated Link: 8952
Date: 2016-11-14 13:38:48
- Time Modification: Remote connect to CentOS or directly log in to the system
date
View system time
date -s
Modify time. See the examples below:
date -s 03/04/2013
(Set the system date to March 4, 2013)
date -s 110:38
(Set the system time to 10:38 AM)
- Timezone Modification
First, view the timezone:
date -R
Modify the timezone: (Write Asia/Shanghai - Shanghai timezone into the current timezone)
cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
Prompt to overwrite, enter Y and press Enter, then
date
View timezone and time (CST, China timezone)