Can I set specific time zone to Azure Functions app?

久未见 提交于 2020-01-24 20:35:06

问题


Please let me hear your advice.

I played the setting of server time zone from UTC to specific time zone at azure web apps and it was good and changed as I expected specific time zone. [PROCESS] App Setting : WEBSITE_TIME_ZONE = Tokyo Standard Time

Now, I want to use specific time zone within function app. But, azure functions app is not settable like as web apps. reference link

But, this ref link expressed like as it only effect on web apps reference link


回答1:


I set WEBSITE_TIME_ZONE = Tokyo Standard Time in the Application settings in the portal and check the time in Kudu, it works fine.

Here is my function Application settings.

If you want to find Application settings, refer to the screenshot.

Update:

I call time inside function's coding (index.js) returned the UTC time.

If you do not specify the date format, the Date will out put as an ISO Date Format, like YYYY-MM-DDTHH:mm:ss.sssZ, actually the time has been changed to Tokyo Standard Time instead of the UTC time.




回答2:


to get the value for a WEBSITE_TIME_ZONE use PowerShell (timezone).id on your local PC. In my case I got "Romance Standard Time"



来源:https://stackoverflow.com/questions/50851519/can-i-set-specific-time-zone-to-azure-functions-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!