zoukankan      html  css  js  c++  java
  • Ubuntu在命令行界面下进行时间设置

    首先要把时区选对了,联网情况下,时间会自动同步,所以只要时区选对了,时间基本就是正确的时间了。

    直接使用tzselect命令,就会出现时区选择的界面。做的还挺人性化的,跟着设置来过就好。

    如果没有能自动同步,那么就要自己去和NTP服务器同步了,命令如下:

    sudo ntpdate vn.pool.ntp.org


    如果没有接入Internet的环境,那么就只好使用date命令来手动设定了。命令格式如下:

    date -s=STRING
    date --set=STRING


    这是man中对date的解释。而针对后面的STRING的要求,就更宽泛了,man中具体是这么写的:

    DATE STRING
           The --date=STRING is a mostly free format human  readable  date  string
           such  as  "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or
           even "next Thursday".  A date string may contain items indicating  cal-
           endar  date,  time of day, time zone, day of week, relative time, rela-
           tive date, and numbers.  An empty string indicates the beginning of the
           day.   The date string format is more complex than is easily documented
           here but is fully described in the info documentation.
    


  • 相关阅读:
    龟兔赛跑(动态规划)
    Dividing (多重背包 搜索)
    第k大值01背包问题
    FATE(完全背包)
    01背包 和 完全背包 详解
    放苹果(动态规划)
    max Sum(简单动态规划)
    连连看 优先对列 应用2
    尺取法
    Square(强大的剪枝)
  • 原文地址:https://www.cnblogs.com/superpig0501/p/3967585.html
Copyright © 2011-2022 走看看