zhxlsuyu

linux修改时区和时间

修改时区不重启

  1.在root下,复制相应的时区文件,替换系统时区文件:
    cp /usr/share/zoneinfo/$主时区/$次时区 /etc/localtime

    例如:
    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime


  2、将当前时间和日期写入BIOS,避免重启后失效
     hwclock

 

修改linux的时间

  root使用date指令:date -s


  1、只修改日期,不修改时间,输入:
    date -s 2007-08-03

  2、只修改时间,输入:
    date -s 14:15:00


  3、同时修改日期时间,注意要加双引号,日期与时间之间有一空格,输入:
    date -s "2007-08-03 14:15:00"

  4、修改完后,记得输入:
    clock -w


  把系统时间写入CMOS

分类:

技术点:

相关文章:

  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2021-06-16
猜你喜欢
  • 2021-12-20
  • 2021-12-11
  • 2022-12-23
  • 2021-07-18
  • 2021-06-17
  • 2022-01-04
相关资源
相似解决方案