-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
.NET 5 preview 4 broke DateTime::ToString() #37897
Comments
Please add full OS version. |
edited |
What happens if you set DOTNET_SYSTEM_GLOBALIZATION_USENLS=true ? (https://docs.microsoft.com/en-us/dotnet/core/run-time-config/globalization) cc @safern |
This is a dupe of: You can change to use NLS as @danmosemsft described above or by adding a runtime configuration switch in your project: |
I used Note that this breaks PowerShell, and I'm not sure they will want to use NLS there--'cos IMVHO this would be a potential cause for PowerShell behaving differently on Windows and on other platforms. Also, @safern claims in #37121 that this was fixed in Preview 5. This is not what I see... (see above). |
Actually I thought the issue that was reported was a dupe of: #35638 which is indeed fixed in Preview 5. For this issue you're reporting, I'm working on a fix and should have something out this week. Thanks for reporting it. |
You're very welcome. For now, I might go for setting |
@safern So this issue should actually be reopened until you merge the fix in, correct? |
(this originates from PowerShell/PowerShell#12755)
Description
Since .NET 5 Preview 4, the
ToString()
method inSystem.DateTime
doesn't abide by the user's date/time formatting preferences.Here's a simple program to repro this:
And here's the output with previews 2 through 5:
Configuration
Windows 10 Pro x64 version 2004 build 19041.329
.NET 5 preview 4 (5.0.0-preview.4.20251.6) and above
Regression?
This is regression over .NET 5 preview 3 (5.0.0-preview.3.20214.6)
Other information
There's the output of the tests, as text:
The text was updated successfully, but these errors were encountered: