hexo/source/_posts/CentOS系统时间和时区查看以及修改的方法.md

51 lines
844 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
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,中国时区)