更改tomcat的时区 [英] Change time zone for tomcat
本文介绍了更改tomcat的时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经下载了 Tomcat 8 并将解压后的文件夹复制到了我需要的路径中.我在运行我的网络应用程序时使用这个 tomcat 作为我的服务器.
I have downloaded Tomcat 8 and copied the unzipped folder in my required path. I am using this tomcat as my server while running my web app.
当我使用java时间包访问系统默认时区时,实际上是我得到的时区.是系统的时钟设置吗?或者是tomcat的设置.
When I access system default time zone using java time package, actually the time zone of what I get. Is it system's clock setting? Or is it tomcat's settings.
我在哪里可以在 tomcat 中设置时区.
Where can I set time zone in tomcat.
推荐答案
- Tomcat 使用操作系统时间设置.
- 设置环境变量最好的地方是tomcat bin目录下的setenv.bat(setenv.sh).使用
set JAVA_OPTS="-Duser.timezone=GMT"
Windows 或export JAVA_OPTS="-Duser.timezone=GMT"
for linux.还要确保 catalina.sh 包含调用 setenv 文件的脚本.默认情况下它应该在那里.
- Tomcat uses OS time settings.
- Best place is to set environment variables is setenv.bat (setenv.sh) in tomcat bin directory. Use
set JAVA_OPTS="-Duser.timezone=GMT"
for windows orexport JAVA_OPTS="-Duser.timezone=GMT"
for linux. Also make sure that catalina.sh contains script to call setenv file. It should be there by default.
这篇关于更改tomcat的时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文