Bug 9452 - DateTime.ToString("ddd, dd MMM yyyy hh:mm:ss GMT") throw ArgumentOutOfRangeException
Summary: DateTime.ToString("ddd, dd MMM yyyy hh:mm:ss GMT") throw ArgumentOutOfRangeEx...
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: 2.10.x
Hardware: Other Linux
: --- normal
Target Milestone: ---
Assignee: Alex Rønne Petersen
Depends on:
Reported: 2013-01-10 09:24 UTC by Matteo Fabbri
Modified: 2015-10-28 07:29 UTC (History)
6 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Matteo Fabbri 2013-01-10 09:24:24 UTC
Platform: ARM A10 (Hackberry board)
SO: ArchLinux ARM

Message:Argument is out of range.

System.Globalization.DateTimeFormatInfo.GetAbbreviatedDayName (DayOfWeek dayofweek)
System.DateTimeUtils.ToString (DateTime dt, Nullable`1 utc_offset, System.String format,System.Globalization.DateTimeFormatInfo dfi)
System.DateTimeUtils.ToString (DateTime dt, System.String format, System.Globalization.DateTimeFormatInfo dfi)
System.DateTime.ToString (System.String format, IFormatProvider provider)
System.DateTime.ToString (System.String format)

No problem observed on different platform or OS
Comment 1 mickeyf 2013-01-15 19:23:51 UTC
Most formats fail entirely on ARM (BeagleBone) either displaying incorrectly or crashing. Test Case:

using System;

namespace dateformattest
	class MainClass
		public static void Main (string[] args)
			Console.WriteLine ("Hello World!");
			// this works on the pc, wrong endian(?) on the ARM
			Console.WriteLine ("yyyy/MM/dd HH:mm:ss Datetimenow is " + DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss"));
			Console.WriteLine ("'G' Datetimenow is " + DateTime.Now.ToString("G"));

			 *  these crash utterly on the ARM:
			Console.WriteLine ("long Datetimenow is " + DateTime.Now.ToLongDateString());
			Console.WriteLine ("local Datetimenow is " + DateTime.Now.ToLocalTime());
			Console.WriteLine ("short date Datetimenow is " + DateTime.Now.ToShortDateString());
			Console.WriteLine ("universal date Datetimenow is " + DateTime.Now.ToUniversalTime());

Comment 2 mickeyf 2013-01-15 19:27:43 UTC
Also surprising that ISO 8601 does not seem to be available as a standard format.
Comment 3 mickeyf 2013-01-17 12:58:45 UTC
Correction - Long Date format is the only one that crashes, the others only display incorrectly.
Comment 4 mickeyf 2013-04-11 11:45:16 UTC
Probably due to #7938
Comment 5 Alex Rønne Petersen 2014-04-30 21:47:33 UTC
Is this still an issue with recent Mono versions?
Comment 6 Alex Rønne Petersen 2015-10-28 07:29:53 UTC
Closing due to inactivity. If this is still an issue with Mono 4.2+ (which has complete armhf support), feel free to reopen.