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
NET6 - Wrong DateTime.ToString() formating when using monoVM and linux-arm #61598
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") - returns 2021-11-15 14:54:33.3378046 -when app is published with -p:UseMonoRuntime=true.
When using default runtime (without -p:UseMonoRuntime=true) it returns 2021-11-15 15:58:30.675
Reproduction Steps
I was testing minimum possible delay with following program:
using System.Diagnostics;
Stopwatch sw = new Stopwatch();
while(true)
{
sw.Restart();
Thread.Sleep(1);
sw.Stop();
Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")} - Elapsed {sw.ElapsedMilliseconds}");
}
compiled with dotnet publish -r linux-arm -p:PublishTrimmed=True -p:TrimMode=Link --self-contained true -c Release -f net6.0 -o bin\dotnet\mono -p:UseMonoRuntime=true for mono VM
and dotnet publish -r linux-arm -p:PublishTrimmed=True -p:TrimMode=Link --self-contained true -c Release -f net6.0 -o bin\dotnet
for default runtime
Expected behavior
fff in DateTime.ToString() should return 1/1000ths of second
Actual behavior
fff in DateTime.ToString() return 1/10 000 000 of second
in screenshot - first with mono, then with dotnet default
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
Tested on 32bit linux-arm on Yocto linux
Activity
ghost added
untriagedNew issue has not been triaged by the area owner
changed the title [-]NET6 - Wrong millisecond time formating when using monoVM[/-][+]NET6 - Wrong DateTime.ToString() formating when using monoVM[/+]on Nov 15, 2021
changed the title [-]NET6 - Wrong DateTime.ToString() formating when using monoVM[/-][+]NET6 - Wrong DateTime.ToString() formating when using monoVM and linux-arm[/+]on Nov 15, 2021
Activity
[-]NET6 - Wrong millisecond time formating when using monoVM[/-][+]NET6 - Wrong DateTime.ToString() formating when using monoVM[/+][-]NET6 - Wrong DateTime.ToString() formating when using monoVM[/-][+]NET6 - Wrong DateTime.ToString() formating when using monoVM and linux-arm[/+]Clockwork-Muse commentedon Nov 15, 2021
.... the formatting code is unlikely to be in a runtime-dependent section. If you completely clean your build directories, does the issue persist?
michaldobrodenka commentedon Nov 15, 2021
Yes, I've retested it, deleted all the bin/obj and publish folders.
michaldobrodenka commentedon Nov 15, 2021
The same program running on Windows PC from VS and deployed to ARM mini PC:

michaldobrodenka commentedon Nov 15, 2021
Deleted bin, obj & publish folders, dotnet clean, then publish with default runtime, it's ok:

michaldobrodenka commentedon Nov 15, 2021
Deleted bin, obj & publish folders, dotnet clean, then publish with mono for win-x64, it's ok also:

michaldobrodenka commentedon Nov 15, 2021
so
michaldobrodenka commentedon Nov 15, 2021
monoVM linux-x64 tested on WSL - also ok
We don't support armel in dotnet - only Tizen does, and that's CoreCLR