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
----------------------------------------------------------------------------
BUT THE EXACT TIME IN PERSIAN IS: "5/12/1383" NOT "11/11/2625", How can I
report it to Microsoft and use thier help to fixing it?

Re: How can I fix Big BUG in PersianCalendar Class? by Larry

Larry
Thu Apr 13 11:36:13 CDT 2006


kourosh wrote:
> 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
> ----------------------------------------------------------------------------
> BUT THE EXACT TIME IN PERSIAN IS: "5/12/1383" NOT "11/11/2625",

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 DevDocs@microsoft.com with a subject field of
Documentation Feedback:PersianCalendar.ToDateTime Method (Int32, Int32,
Int32, Int32, Int32, Int32, Int32, Int32)

--
Larry Lard
Replies to group please


Re: How can I fix Big BUG in PersianCalendar Class? by kourosh

kourosh
Thu Apr 13 11:48:01 CDT 2006

unfortunately the bug is in the toDateTime(...), and the example shows it
very well.


"Larry Lard" wrote:

>
> kourosh wrote:
> > 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
> > ----------------------------------------------------------------------------
> > BUT THE EXACT TIME IN PERSIAN IS: "5/12/1383" NOT "11/11/2625",
>
> 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
> <c> 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 DevDocs@microsoft.com with a subject field of
> Documentation Feedback:PersianCalendar.ToDateTime Method (Int32, Int32,
> Int32, Int32, Int32, Int32, Int32, Int32)
>
> --
> Larry Lard
> Replies to group please
>
>

Re: How can I fix Big BUG in PersianCalendar Class? by Mattias

Mattias
Thu Apr 13 12:45:05 CDT 2006


>How can I report it to Microsoft and use thier help to fixing it?

You can report bugs at http://msdn.microsoft.com/productfeedback/ and
a good group to discuss things like this is
microsoft.public.dotnet.internationalization


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.