Home All Groups Group Topic Archive Search About

How can I fix Big BUG in PersianCalendar Class?

Author
13 Apr 2006 4:14 PM
kourosh
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?

Author
13 Apr 2006 4:36 PM
Larry Lard
kourosh wrote:
Show quote
> 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 DevD***@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
Author
13 Apr 2006 4:48 PM
kourosh
unfortunately the bug is in the toDateTime(...), and the example shows it
very well.


Show quote
"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 DevD***@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
>
>
Author
13 Apr 2006 5:45 PM
Mattias Sjögren
>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.

AddThis Social Bookmark Button