mirror of https://github.com/jkjoy/sunpeiwen.git
51 lines
794 B
Markdown
51 lines
794 B
Markdown
---
|
||
title: CentOS系统时间和时区查看以及修改的方法
|
||
tags:
|
||
- centos
|
||
- VPS
|
||
excerpt: ''
|
||
categories: 分享
|
||
abbrlink: 8952
|
||
date: 2016-11-14 13:38:48
|
||
---
|
||
|
||
一、时间修改 远程连接到centos 或者直接登录系统
|
||
|
||
```
|
||
date
|
||
```
|
||
查看系统时间
|
||
|
||
|
||
```
|
||
date -s
|
||
```
|
||
修改时间 看下面的例子
|
||
|
||
```
|
||
date -s 03/04/2013
|
||
```
|
||
(将系统日期设定为2013年03月04日)
|
||
```
|
||
date -s 110:38
|
||
```
|
||
(将系统时间设定为上午 10:38)
|
||
|
||
二、时区修改
|
||
|
||
先查看时区
|
||
```
|
||
date -R
|
||
```
|
||
|
||
修改时区: (将Asia/shanghai-上海时区写入当前时区)
|
||
|
||
```
|
||
cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||
```
|
||
|
||
提示是否覆盖,输入Y回车, 然后
|
||
```
|
||
date
|
||
```
|
||
查看时区和时间(CST,中国时区) |