gpt4 book ai didi

java - Linux服务器如何永久更改时区

转载 作者:太空宇宙 更新时间:2023-11-04 04:39:06 25 4
gpt4 key购买 nike

  1. 我正在通过 tzselect 更改时区,但注销时该时区更改为默认时区。如何永久地进行此更改?

  2. 服务器时区也应该反射(reflect) mysql 时区。如何做到这一点?

最佳答案

I am changing the time zone by tzselect but on logout this time zone changes to default one. How to make this change permanently ?

请按照以下步骤操作:

$ date
Fri Dec 20 09:42:24 UTC 2013

$ rm -rf /etc/localtime

$ ln -s /usr/share/zoneinfo/US/Pacific /etc/localtime

$ date
Fri Dec 20 01:43:19 PST 2013

重点是,您需要使用位于/usr/share/zoneinfo/下的所需zoneinfo文件

Server time zone should also reflect on the mysql time zone. How to do this ?

我无法正确解释上述陈述。但似乎您应该使用 NTP,以便所有服务器的时间都是相同的。

关于java - Linux服务器如何永久更改时区,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20700509/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com