banner
老孙

老孙博客

资深网民孙先生
mastodon
email

Method to view and modify CentOS system time and timezone

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
  1. 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)

  1. 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)

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.