You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Formatting TimeSpan with %A prints TotalMilliseconds instead of formatted TimeSpan #2409
During runtime TimeSpan becomes just milliseconds -- which is printed without any additional formatting.
It's probably not even possible to format: Type information isn't available at runtime and it's just a number (the milliseconds). So it might not be possible to distinguish TimeSpan from just number. But it still bites me every time I want to print a TimeSpan for debugging...
Workaround: manually call ToString() on TimeSpan. But that's only possible when it's known to be a TimeSpan.
As commented in several other issues, unfortunately print formatting is not the same as .NET and particularly %A doesn't really do anything atm. To be fix this I guess we'd have to use a proper type for TimeSpan instead of just erasing it into a number, which would require some work. For now, let's close this issue and consolidate it with #2408
Activity
alfonsogarciacaro commentedon Jul 12, 2021
As commented in several other issues, unfortunately print formatting is not the same as .NET and particularly
%Adoesn't really do anything atm. To be fix this I guess we'd have to use a proper type forTimeSpaninstead of just erasing it into a number, which would require some work. For now, let's close this issue and consolidate it with #2408