CloudFoundry时区 [英] CloudFoundry Timezone

查看:137
本文介绍了CloudFoundry时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个非常以(JodaTime)为中心的DateTime(日历等)的应用程序。在我的计算机本地,一切正常。我已将我的应用程序部署在cloudfoundry上,日历中没有可见的日期。
我想这与cloudfoundry的时区有关。我已将本地运行的应用程序连接到该数据库中的mongodb数据库,并且一切正常。
我现在的问题是如何将cloudfoundry的时区更改为CEST(MEZ)?

I have developed an application which is very (JodaTime) DateTime centric (calendar and so on). Locally at my computer all works fine. I have deployed my app at cloudfoundry and there no dates are visible in the calendar. I guess that this has something to do with the timezone of cloudfoundry. I have connected my locally running application to the mongodb database in the coud and everything works find. My question now would be how to change timezone at cloudfoundry to CEST (MEZ)?

非常感谢!

推荐答案

您的Java应用程序将在Linux容器中运行,因此您可以使用任何设置时区的Linux或Java方法。

Your Java application is going to run in a Linux container, so you can use any Linux or Java method of setting the timezone.

容易想到的东西...

The easy ones that come to mind...

cf set-env< app-name> TZ'America / Los_Angeles'
cf restage< app-name>

cf集-env< app-name> JAVA_OPTS’-Duser.timezone =欧洲/索非亚’
cf restage< app-name>

第一个应该对任何尊重TZ环境变量的应用程序通用。第二个特定于Java。

The first should be generic to any application that respects the TZ environment variable. The second is specific to Java.

如果您不想使用 cf set-env ,则可以选择通过 manifest.yml 文件设置环境变量。

If you don't want to use cf set-env you could alternatively set the environment variables via your manifest.yml file.

这篇关于CloudFoundry时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆