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
Mono 6.12.0.199 is compiled from source tarball. csc works well. but any call to DateTime.Now fails with exception: System.ArgumentOutOfRangeException: The TimeSpan parameter must be within plus or minus 14.0 hours. The result doesn't depend on TZ env var (PST, UTC, etc)
DateTime.UtcNow works well.
Steps to Reproduce
Mono 6.12.0.199 is compiled from source tarball with default autogen.sh options on the mipsel host without any crosscompilers. libc 2.27, kernel 4.9, gcc 8.4.
Tests using bash:
TMPDIR="${TMPDIR:-/tmp}"echo'using System; using System.Diagnostics; class Program { static void Main() { Console.WriteLine($"Hello, World. Version {Environment.Version}. Working Set {Process.GetCurrentProcess().WorkingSet64:n0} bytes"); } }'>"$TMPDIR/probe-hello.cs"echo'using System; using System.Diagnostics; class Program { static void Main() { Console.WriteLine($"UTC NOW: {DateTime.UtcNow}"); } }'>"$TMPDIR/probe-utcnow.cs"echo'using System; using System.Diagnostics; class Program { static void Main() { Console.WriteLine($"NOW: {DateTime.Now}"); } }'>"$TMPDIR/probe-now.cs"forfin now hello utcnow;doecho"";echo"PROBE $f"
csc -nologo -out:"$TMPDIR/probe-$f.exe""$TMPDIR/probe-$f.cs"
mono "$TMPDIR/probe-$f.exe"done
Output:
PROBE now
Unhandled Exception:
System.ArgumentOutOfRangeException: The TimeSpan parameter must be within plus or minus 14.0 hours.
Parameter name: baseUtcOffset
at System.TimeZoneInfo.ValidateTimeZoneInfo (System.String id, System.TimeSpan baseUtcOffset, System.TimeZoneInfo+AdjustmentRule[] adjustmentRules, System.Boolean& adjustmentRulesSupportDst) [0x00034] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo..ctor (System.String id, System.TimeSpan baseUtcOffset, System.String displayName, System.String standardDisplayName, System.String daylightDisplayName, System.TimeZoneInfo+AdjustmentRule[] adjustmentRules, System.Boolean disableDaylightSavingTime) [0x00006] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo+CachedData.CreateLocal () [0x0001f] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo+CachedData.get_Local () [0x0000c] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo.get_Local () [0x00000] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo.GetDateTimeNowUtcOffsetFromUtc (System.DateTime time, System.Boolean& isAmbiguousLocalDst) [0x00000] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.DateTime.get_Now () [0x00008] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at Program.Main () [0x00001] in <0ed61e189ff24567a594f9ba0c4c0650>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException: The TimeSpan parameter must be within plus or minus 14.0 hours.
Parameter name: baseUtcOffset
at System.TimeZoneInfo.ValidateTimeZoneInfo (System.String id, System.TimeSpan baseUtcOffset, System.TimeZoneInfo+AdjustmentRule[] adjustmentRules, System.Boolean& adjustmentRulesSupportDst) [0x00034] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo..ctor (System.String id, System.TimeSpan baseUtcOffset, System.String displayName, System.String standardDisplayName, System.String daylightDisplayName, System.TimeZoneInfo+AdjustmentRule[] adjustmentRules, System.Boolean disableDaylightSavingTime) [0x00006] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo+CachedData.CreateLocal () [0x0001f] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo+CachedData.get_Local () [0x0000c] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo.get_Local () [0x00000] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo.GetDateTimeNowUtcOffsetFromUtc (System.DateTime time, System.Boolean& isAmbiguousLocalDst) [0x00000] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.DateTime.get_Now () [0x00008] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at Program.Main () [0x00001] in <0ed61e189ff24567a594f9ba0c4c0650>:0
PROBE hello
Hello, World. Version 4.0.30319.42000. Working Set 12,591,104 bytes
PROBE utcnow
UTC NOW: 01/22/2024 06:01:47
Current Behavior
Expected Behavior
On which platforms did you notice this
[ ] macOS
[x] Linux
[ ] Windows
Version Used:
6.12.0.199
Stacktrace
System.ArgumentOutOfRangeException: The TimeSpan parameter must be within plus or minus 14.0 hours.
Parameter name: baseUtcOffset
at System.TimeZoneInfo.ValidateTimeZoneInfo (System.String id, System.TimeSpan baseUtcOffset, System.TimeZoneInfo+AdjustmentRule[] adjustmentRules, System.Boolean& adjustmentRulesSupportDst) [0x00034] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo..ctor (System.String id, System.TimeSpan baseUtcOffset, System.String displayName, System.String standardDisplayName, System.String daylightDisplayName, System.TimeZoneInfo+AdjustmentRule[] adjustmentRules, System.Boolean disableDaylightSavingTime) [0x00006] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo+CachedData.CreateLocal () [0x0001f] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo+CachedData.get_Local () [0x0000c] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo.get_Local () [0x00000] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.TimeZoneInfo.GetDateTimeNowUtcOffsetFromUtc (System.DateTime time, System.Boolean& isAmbiguousLocalDst) [0x00000] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at System.DateTime.get_Now () [0x00008] in <a17d4f29e4f344d29b3db8a9764ba712>:0
at Program.Main () [0x00001] in <0ed61e189ff24567a594f9ba0c4c0650>:0```
The text was updated successfully, but these errors were encountered:
Mono 6.12.0.199 is compiled from source tarball. csc works well. but any call to
DateTime.Now
fails with exception:System.ArgumentOutOfRangeException: The TimeSpan parameter must be within plus or minus 14.0 hours.
The result doesn't depend on TZ env var (PST, UTC, etc)DateTime.UtcNow works well.
Steps to Reproduce
Mono 6.12.0.199 is compiled from source tarball with default autogen.sh options on the mipsel host without any crosscompilers. libc 2.27, kernel 4.9, gcc 8.4.
Tests using bash:
Output:
Current Behavior
Expected Behavior
On which platforms did you notice this
[ ] macOS
[x] Linux
[ ] Windows
Version Used:
6.12.0.199
Stacktrace
The text was updated successfully, but these errors were encountered: