Ubuntu修改系统时间
在新版的ubuntu中,使用timedatectl 替换了ntpdate来进行时间管理。
1.查看当前时间状态
查看当前时间状态 timedatectl status :
res@ubuntu:~$ timedatectl status
Local time: 三 2019-01-02 17:22:13 PST
Universal time: 四 2019-01-03 01:22:13 UTC
RTC time: 三 2019-01-02 17:22:14
Time zone: America/Los_Angeles (PST, -0800)
System clock synchronized: yes
systemd-timesyncd.service active: yes
RTC in local TZ: yes
系统显示的时间是错误的,错误原因也是显而易见的,使用的是America/Los_Angeles的时区。
因此只要修改时区就能保证时间的正确。
2.修改时区
所有的时区名称存储在/usr/share/zoneinfo文件中。
执行命令timedatectl set-timezone "Asia/Shanghai" 就可以将时区设为上海时区。
res@ubuntu:~$ timedatectl set-timezone "Asia/Shanghai"
重新查看当前时间状态 timedatectl status :
res@ubuntu:~$ timedatectl status
Local time: 四 2019-01-03 10:59:05 CST
Universal time: 四 2019-01-03 02:59:05 UTC
RTC time: 四 2019-01-03 10:59:05
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: no
systemd-timesyncd.service active: yes
RTC in local TZ: yes
此时时间已经正常了。
Ubuntu修改系统时间的更多相关文章
- 【linux】ubuntu修改系统时间
ubuntu修改时间步骤 ① 先把系统校验时间的程序停止掉 /lib/systemd/systemd-timesyncd systemd 开始,包括了一个名为systemd-timesyncd 的守护 ...
- ubuntu 修改系统时间无效
用root用户修改服务器时间无效:使用hwclock -w也不行 解决方法: 需要取消自动从互联网同步时间才可以的 timedatectl set-ntp 0 上面的命令可以关闭自动同步,然后你再设置 ...
- ubantu/centos修改系统时间
前言:有时系统上的时间和真实的时间对应不是,或者有特殊需求,需要修改系统时间.但是对应多台的服务器系统更改时间,手动的话很麻烦,这就需要写脚本或者搭建时间服务器了,统一时间,以下是对于一个不同系统修改 ...
- linux下修改系统时间
一.查看时间: [root@localhost ~]# date2016年 11月 19日 星期六 12:46:37 CST 二.修改时间,修改系统时间 [root@localhost ~]# dat ...
- Linux下修改系统时间并写入BIOS
我们一般使用“date -s”命令来修改系统时间.比如将系统时间设定成2005年7月26日的命令如下. #date -s 07/26/2005 将系统时间设定成下午11点12分0秒的命令如下. #da ...
- ubuntu设置系统时间与网络时间同步
ubuntu设置系统时间与网络时间同步 Linux的时间分为System Clock(系统时间)和Real Time Clock (硬件时间,简称RTC). 系统时间:指当前Linux Ker ...
- Wince修改系统时间问题
当我们需要修改到系统时间的时候,需要用到下面四个函数:SetLoaclTime,GetLocalTime,SetSystemTime,GetSystemTime.这四个函数是用来修改或者 ...
- Linux怎样修改系统时间
修改linux的时间可以使用date指令 修改日期: 时间设定成2009年5月10日的命令如下: #date -s 05/10/2009 修改时间: 将系统时间设定成上午10点18分0秒的命令如下. ...
- linux修改系统时间date命令加clock -w
http://m.jb51.net/LINUXjishu/117784.html 修改linux系统时间的方法(date命令) 11-18 23:22:27作者:脚本之家 命令格式为: date -s ...
随机推荐
- MySQL相关sql语句
登陆mysql: mysql -hlocalhost -uroot -proot 创建数据库:create database dbname charset utf8 查看数据库:show databa ...
- 计算系统中互联设备Survey
Survey of Inter-connects in computer system 姚伟峰 http://www.cnblogs.com/Matrix_Yao/ https://github.co ...
- JS数据类型之Number类型
Number类型的转换及方法 var num = 10; num.toString() //"10"转字符串,参数表示几进制 num.toFixed(2) //10.00 自动舍入 ...
- python flask 解决中文乱码
response = make_response(output_string)response.headers['Content-Type'] = 'text/plain;charset=UTF-8' ...
- Linux NGINX部署
一.Nginx简介 Nginx是一个web服务器也可以用来做负载均衡及反向代理使用,目前使用最多的就是负载均衡,具体简介我就不介绍了百度一下有很多,下面直接进入安装步骤 二.Nginx安装 1.下载N ...
- Beanstalkd消息队列 -- php类Pheanstalk使用
业务场景 商城订单生成30分钟后 如果未支付关闭订单 解决办法 可以使用延迟消息队列 这里我们用的是beanstalkd Beanstalkd介绍 Beanstalk,一个高性能.轻量级的分布式内 ...
- 16. 3Sum Closest (JAVA)
Given an array nums of n integers and an integer target, find three integers in nums such that the s ...
- Educational Codeforces Round 43 (Rated for Div. 2)
Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...
- BootStrap插件
站点引用 Bootstrap 插件的方式有两种: 单独引用:使用 Bootstrap 的个别的 *.js 文件.一些插件和 CSS 组件依赖于其他插件.如果您单独引用插件,请先确保弄清这些插件之间的依 ...
- TreeView的三种状态,全选,全不选,半选中
我知道的设置treeview节点的三种状态,如果不是买的控件,那么通过代码,只能设置两种状态,我知道的有三种方法, 第一种是重写treeview,第二种是把三种状态做成小图标,让节点复选框随着不同的状 ...