5

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
  • This case was caused by the missing of right format usage. It can be solved by adding the WEBSITE_TIME_ZONE at function app setting and then used the right format inside the calling function. I want to thanks to @Joy Wang for your participation.
    – Khin Thet
    Jun 15, 2018 at 2:26

2 Answers 2

26

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

enter image description here

Here is my function Application settings.

enter image description here

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

enter image description here

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.

10
  • Yeah....I think that you mean 'web app' application setting, can you also test at 'functions app' application setting that was my problem place.
    – Khin Thet
    Jun 14, 2018 at 7:27
  • @KhinThet No, this is a function app, please check my screenshot. If you want to access it, go to your function app in the portal -> Platform features ->Application settings , and you will find it.
    – Joy Wang
    Jun 14, 2018 at 7:35
  • Just I'm mad. I call time inside function's coding (index.js) returned the UTC time. :(
    – Khin Thet
    Jun 14, 2018 at 7:59
  • 1
    Hey...I coded like that. ............................................................................................................................................... var fmtDate = current.getFullYear() + "/" + ("0"+(current.getMonth() + 1)).slice(-2) + "/" + ("0"+current.getDate()).slice(-2); var fmttime = ("0"+current.getHours()).slice(-2) + ":" + ("0"+current.getMinutes()).slice(-2) + ":" + ("0"+current.getSeconds()).slice(-2); ====> "fmtDate": "2018/06/15", "fmttime": "10:40:53",
    – Khin Thet
    Jun 15, 2018 at 1:44
  • 1
    A point to NOTE: WEBSITE_TIME_ZONE is not currently supported on the Linux Consumption plan as mentioned here just in case someone else lands into this thread.
    – krishg
    Oct 12, 2020 at 11:52
8

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"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.