-
Couldn't load subscription status.
- Fork 5.2k
Closed
Description
Description
On Android, some cultures have an incorrect general long time pattern, causing DateTime.ToString(IFormatProvider) to produce badly formatted strings.
Reproduction Steps
Consider the following code:
new DateTime(2000, 1, 1, 20, 0, 0).ToString(new CultureInfo("zh-TW"));Expected behavior
A correctly formatted string (like 2000/1/1 下午8:00:00) is returned.
Actual behavior
A badly formatted string 2000/1/1 8:00:00 is returned, in which a 12-hour clock is used without an AM/PM designator.
Regression?
No response
Known Workarounds
No response
Configuration
- .NET version: 8.0
- Target operating system: Android
- Architecture: x64, arm64
- Android version: 13 (tested both on an emulator and a physical device)
Other information
No response