WEBSITE_TIME_ZONE is set but not going through the app setting

asked 2021-05-07T04:29:37.833+00:00
Milad Ildoromi 1 Reputation point

I set the WEBSITE_TIME_ZONE in the application setting to New Zealand Standard Time
94616-image.png

And in the console when I check the date
94520-image.png

it has not been applied, I went to the resource explorer and checked the value in the config which is set to null
94459-image.png
Any ideas?

Azure Web Apps
Azure Web Apps
A feature of Azure App Service used to create and deploy scalable, mission-critical web apps.
4,306 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. answered 2021-05-07T14:24:56.857+00:00
    SnehaAgrawal-MSFT 11,096 Reputation points Microsoft Employee

    Thanks for asking question! Could you please confirm after setting WEBSITE_TIME_ZONE variable in Application settings you have saved and restarted the app.

    94787-demoq1.png

    94739-demoq3.png

    You may refer to this article for supported timezone values.

    further to verify that whether offset is updated or not navigate to Console and execute time command.

    94740-demoq2.png

    Also, for the App services that run on Windows, see the Timezone column in the Default Time Zones article for accepted values. For the App services that run on Linux, set the TZ database name as the time zone value.

    Note that the above setting works without making any changes in the code. TimeZoneInfo.ConvertTimeBySystemTimeZoneId.
    If you used the overload that accepts a DateTime, then be aware that if .Kind is DateTimeKind.Unspecified then it will be treated as local time.

    If you didn't change the WEBSITE_TIME_ZONE, then the default local time is UTC. But if you did, then that would affect the behavior.

    You may also check this doc for more details on converting times between timezones.

    Let us know if further query or issue remains.

    No comments