zoukankan      html  css  js  c++  java
  • Ubuntu修改系统时间

    在新版的ubuntu中,使用timedatectl 替换了ntpdate来进行时间管理。

    1.查看当前时间状态

    查看当前时间状态 timedatectl status :

    wxs@ubuntu:~/6-1/task4$ timedatectl status Local time: Tue 2017-11-07 18:14:30 PST Universal time: Wed 2017-11-08 02:14:30 UTC RTC time: Wed 2017-11-08 02:14:29 Time zone: America/Los_Angeles (PST, -0800) Network time on: yesNTP synchronized: yes RTC in local TZ: no

    系统显示的时间是错误的,错误原因也是显而易见的,使用的是America/Los_Angeles的时区。

    因此只要修改时区就能保证时间的正确。

    2.修改时区

    所有的时区名称存储在/usr/share/zoneinfo文件中。

    执行命令timedatectl set-timezone "Asia/Shanghai" 就可以将时区设为上海时区。

    ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-timezone ===Authentication is required to set the system timezone.Authenticating as: wxs,,, (wxs)Password: ==== AUTHENTICATION COMPLETE ===

    重新查看当前时间状态 timedatectl status :

    wxs@ubuntu:~/6-1/task4$ timedatectl status Local time: Wed 2017-11-08 10:15:45 CST Universal time: Wed 2017-11-08 02:15:45 UTC RTC time: Wed 2017-11-08 02:15:45 Time zone: Asia/Shanghai (CST, +0800) Network time on: yesNTP synchronized: yes RTC in local TZ: no

    此时时间已经正常了。
  • 相关阅读:
    关于数据库的基础知识
    Oracle数据库的上机作业
    PHP表单处理
    EasyUI DataGrid结合ThinkPHP实现增删改查操作———初学者
    Redis crackit
    nodeppt安装后,phantomjs不能运行了 Bad argument
    redis命令
    eclipse编辑web.xml很慢
    客制化jasperreport导出html的过程
    dynamicreport, JFreeChart
  • 原文地址:https://www.cnblogs.com/peng-lan/p/9604761.html
Copyright © 2011-2022 走看看