How do I set the timezone in Tomcat for a single web app?

前端 未结 8 1922
春和景丽
春和景丽 2021-02-05 13:00

What is the best way to set the time zone in Tomcat for a single web app? I\'ve seen options for changing the command-line parameters or environment variables for Tomcat, but is

8条回答
  •  时光取名叫无心
    2021-02-05 13:31

    Check out the SimpleTimeZone. You can create an instance based on a time zone ID and use that to display dates/times using that time zone. If you wanted, you could read that ID from a project specific configuration file.

提交回复
热议问题