-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Blazor Server Localization Middleware works but local time is always UTC. #23662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Actually, I think this may be a dupe of this issue but those were clearly WASM/Client-side Blazor, so not sure. I've also deployed to West US 2: |
The problem isn't specific to Blazor, but to .NET Core in general. The runtime has a mechanism to set the @DamianEdwards did we evaluate this scenario when designing the localization middleware? |
@pranavkm , thanks for the info! Not a show stopper. I attempted to implement the solution with JS (momenjs) but unfortunately, the returned JS localized date doesn't appear on the screen unless a user does something on the screen or a new item is added to the list (I display a list in a for loop) & the screen is updated. I may open up another ticket for that but more than likely, will just wait until the feature is added as I would like to stay away from JS if I can. Thanks |
Hi. Thanks for contacting us. |
I would like to mention that there is a community interest, because we would like to use Blazor Server in a enterprise environment with multiple locations. For know it seems like there is just the workaround with Javascript, which is (in my opinion) really bad. |
Describe the bug
Blazor Server Localization Middleware doesn't appear to work, ie it doesn't appear to convert UTC dates to local time.
I have followed the official guide to setup the Blazor Server Localization Middleware. As a test, I have deployed my app to South Korea (Azure) & I am printing out the UTC & Local Time.
I am located in Texas & when I browse the app, the UTC is displayed, even if I use
ToLocalTime()
To Reproduce
Public repo can be found here
The relevant files are:
Startup.cs
_Host.cshtml
Index.razor
Exceptions (if any)
None (I am a Blazor newb, so could be user error 👍 )
Further technical details
The text was updated successfully, but these errors were encountered: