Ubuntu虚拟机中时间与windows时间不一致的问题解决

方法一:设置时区

在ubuntu的终端中执行命令:

sudo tzselect

 依次选择:

4) Asia   

9) China

1) Beijing Time
1) Yes

之后会有提示如下:

You can make this change permanent for yourself by appending the line
    TZ='Asia/Shanghai'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Shanghai

 创建时区

sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

方法二:使用NTP服务

sudo atp install ntp 或者在Ubuntu的UI中根据提示选择NTP更新时间。

posted @ 2020-11-22 23:04  稀里糊涂的胡闹  阅读(860)  评论(0)    收藏  举报