Hi all,
I've added in our core module the following settings in order to support UTC time and multitimezone
//Adding setting providers
Configuration.Settings.Providers.Add<AppSettingProvider>();
Configuration.Settings.Providers.Add<TimingSettingProvider>();
Clock.Provider = ClockProviders.Utc;
And then in our appsettings the default TimeZone
"Abp": {
"Timing": {
"TimeZone": "GMT Standard Time"
}
},
However when I run the project it always displays UTC as the default timezone. As a workaround I've removed TimingSettingProvider and added it manuallly in my shared settings the following that will read that property from appsettings. Did I missed something here?
new SettingDefinition(TimingSettingNames.TimeZone,
GetFromSettings("Abp:Timing:Timezone", "UTC"), null, //TODO: Can we use here localization?
scopes: SettingScopes.Application | SettingScopes.Tenant | SettingScopes.User,
clientVisibilityProvider: new VisibleSettingClientVisibilityProvider())
Regards
4 Answer(s)
-
0
What's wrong?
-
0
If I use
Configuration.Settings.Providers.Add<TimingSettingProvider>();
then I can't change the default timezone in appsetting.config it's always UTC no matter if I add the setting there. My question is how TimingSettingProvider can be updated via Environmental config settings or appsettings.
-
0
Hi @klir
You need to restart the app after changing the setting value in appsettings.json file. Settings are cached at the application startup.
Also be sure that there is no user/tenant specific setting about TimingSettingNames.TimeZone in AbpSettings table.
-
0
Please reopen if you are still having this problem.