Search Issue Tracker
By Design
By Design in 2023.1.X
Votes
0
Found in
2020.3.40f1
2021.3.11f1
2022.1.19f1
2022.2.0b10
2023.1.0a13
Issue ID
UUM-16384
Regression
No
Debug.Log applies formatting for date and time in the DateTime struct when using string interpolation
Reproduction steps:
- Open attached “Debug.Log” project
- Open “Sample Scene” scene
- Enter the Play mode
Expected result: Two dates in the Console have the same formatting
Actual result: Two dates in the Console don’t have the same formatting
Reproducible with: 2020.3.40f1, 2021.3.11f1, 2022.1.19f1, 2022.2.0b10, 2023.1.0a13
Reproduced on: Windows 10
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Frame Debugger is not disabled when switching Scenes if the Frame Debugger window is not open during the transition
- Standalone Profiler Targets another Project if a Standalone Profiler was launched in it before when switching between Edit or Play Mode Targets
- Crash on ForwardRenderLoopJob when opening a specific project
- [Android] Memory leak and eventual crash on Snapdragon 8 Gen 1+ devices when a Clear Pass is executed after Framebuffer Fetch
- Crash on EnumerateDisabledKeywordsInVariantsArray or UNITY_XXH32 when rapidly saving ShaderGraph or VFXGraph changes
Resolution Note:
This is by design, `Debug.Log(...)` with any object that is `IFormattable` will automatic be displayed using an `InvariantCulture` while string interpolation will by default use the current culture.
The workaround is to explicit specify the culture you want or use `FormattableString.Invariant()` for your string interpolations to get them to display them in the same way as `Debug.Log()`
For example `Debug.Log(FormattableString.Invariant($"{DateTime.Now}"));`
Resolution Note (2023.1.X):
This is by design, `Debug.Log(...)` with any object that is `IFormattable` will automatic be displayed using an `InvariantCulture` while string interpolation will by default use the current culture.
The workaround is to explicit specify the culture you want or use `FormattableString.Invariant()` for your string interpolations to get them to display them in the same way as `Debug.Log()`
For example `Debug.Log(FormattableString.Invariant($"{DateTime.Now}"));`