-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
DateTime returns wrong time after updating target framework to net5.0 #41429
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
cc: @marek-safar Thanks for logging the issue @pureggerstefan can you please verify which version of the sdk did you use when you updated to .NET 5? I ask because we recently (I think it was after preview 7 sdk) changed how TimeZone info is packed in a wasm app but the default is that we will pack the timezone info with your application and you should get the right behavior when doing DateTime.Now unless you manually set the property: #37973 (comment) which will force UTC to always be used. The purpose of this property is to make your wasm app smaller since it won't need to pack the TimeZone info on your app, but as I said the default is to pack it unless you set the property. |
FWIW I just tried preview 8 and it seems like DateTime.Now is correctly displaying localized TimeZone for me. @pureggerstefan I would suggest updating to preview 8 and trying again, it should work. |
/cc @EgorBo |
@joperezr Thank you! Updating from preview 7 to 8 solved the issue. Now every information displayed is correct. |
After updating a Blazor WebAssembly App to .net5.0 a problem with DateTime occurs. When using e.g. DateTime.Now, it does not access the local time on my machine, instead it returns the current UTC-Time instead of the expected CEST. Changing any of my settings on the local machine does not affect the given value. With the previous used framework (.netstandard2.1), this problem does not occur.
The text was updated successfully, but these errors were encountered: