How can I fix Big BUG in PersianCalendar Class?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I try to use example in the PersianCalendar Class help I found this big
bug:

PersianCalendar jc = new PersianCalendar();
DateTime thisDate = DateTime.Now;
DateTime dt1 = new DateTime(thisDate.Year, thisDate.Month, thisDate.Day, 20,
30, 15, 500);
DateTime dt2 = jc.ToDateTime(thisDate.Year, thisDate.Month, thisDate.Day,
20, 30, 15, 500, PersianCalendar.PersianEra);
Console.WriteLine("ToDateTime:");
Console.WriteLine(" Gregorian calendar: {0}\n" + " Persian calendar:
{1}", dt1, dt2);
 
kourosh said:
When I try to use example in the PersianCalendar Class help I found this big
bug:

PersianCalendar jc = new PersianCalendar();
DateTime thisDate = DateTime.Now;
DateTime dt1 = new DateTime(thisDate.Year, thisDate.Month, thisDate.Day, 20,
30, 15, 500);
DateTime dt2 = jc.ToDateTime(thisDate.Year, thisDate.Month, thisDate.Day,
20, 30, 15, 500, PersianCalendar.PersianEra);
Console.WriteLine("ToDateTime:");
Console.WriteLine(" Gregorian calendar: {0}\n" + " Persian calendar:
{1}", dt1, dt2);
----------------------------------------------------------------------------
This code example produces the following results:
ToDateTime:
Gregorian calendar: 8/20/2004 8:30:15 PM
Persian calendar: 11/11/2625 8:30:15 PM

I'd say this is a bug in *this example* (it is inappropriate to pass a
Gregorian year to PersianCalendar.ToDateTime) rather than the class
itself; do you agree?
How can I
report it to Microsoft and use thier help to fixing it?

Where are you viewing this example? The online version at
<http://msdn2.microsoft.com/en-us/library/ms226567.aspx> has a comment
box at the bottom of the page (I don't know how much these get read);
the offline version in the help I got with VB2005 has a 'Send comments'
link that is a mailto: to (e-mail address removed) with a subject field of
Documentation Feedback:PersianCalendar.ToDateTime Method (Int32, Int32,
Int32, Int32, Int32, Int32, Int32, Int32)
 
Back
Top