Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Timezone settings not showing up #2057


User avatar
0
leop created

The Timezone setting options are not showing up for me in the settings.

I see there is this code that may be preventing it from showing in App\Views\Settings\Index.cshtml

@if (!ViewBag.IsMultiTenancyEnabled || Clock.SupportsMultipleTimezone)

What is the reason for clock.SupportsMultipleTimezone? Is that another setting or detected automatically?

Thanks!


6 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Clock.SupportsMultipleTimezone is true only when you use UtcClockProvider for Clock.Provider. Maybe that is why you don't see timezone settings.

  • User Avatar
    0
    leop created

    Thanks for the info, this resolved my issue.
    More info on this can be found here: <a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/Timing">http://aspnetboilerplate.com/Pages/Documents/Timing</a>

    I set the value in the Core module PreInitialize() -- is this the correct location to set the value, or should it be set in Web module? It appears to work correctly.

    Clock.Provider = ClockProviders.Utc;
    
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can even set it in the Application_Start of Global.asax if you are not using ASP.NET Core version.

  • User Avatar
    0
    trendline created

    Where to set the clock provider in asp.net core mvc edition?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @trendline,

    You can do it in the PreInitialize of your Core module.

  • User Avatar
    0
    trendline created

    Done, thanks.