Intellij 时区与我的机器/国家时间不对应

问题描述 投票:0回答:1

我的 Intellij 时区与我的机器/国家/地区时间不同,当我尝试运行我的 spring-boot 应用程序时,运行控制台显示的时间比我的机器时间少,另一个问题是当我尝试坚持到 MySQL 时,具有 java.util.Date 的字段节省了 intellij 中显示的时间,而不是我的本地计算机。

2022-03-19 23:53:35.636
INFO 14604 --- [ main] c.c.c.ConfigServicePropertySourceLocator :从服务器获取配置:http://localhost:8888

应该是 GMT+01:00 :

2022-03-19 00:53:35.636
INFO 14604 --- [ main] c.c.c.ConfigServicePropertySourceLocator :从服务器获取配置:http://localhost:8888

intellij-idea
1个回答
0
投票

如果您想更改时区,您可以通过虚拟机选项控制时区。

打开运行/调试配置并单击添加虚拟机选项

enter image description here

在虚拟机选项下,输入所需的时区。示例:-Duser.timezone="UTC" 如果您想要 UTC。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.