HighTechTalks DotNet Forums  

How can I fix Big BUG in PersianCalendar Class?

Dotnet Framework microsoft.public.dotnet.framework


Discuss How can I fix Big BUG in PersianCalendar Class? in the Dotnet Framework forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
kourosh
 
Posts: n/a

Default How can I fix Big BUG in PersianCalendar Class? - 04-13-2006 , 11:14 AM






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?

Reply With Quote
  #2  
Old   
Larry Lard
 
Posts: n/a

Default Re: How can I fix Big BUG in PersianCalendar Class? - 04-13-2006 , 11:36 AM







kourosh wrote:
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?

Quote:
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 (AT) microsoft (DOT) 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



Reply With Quote
  #3  
Old   
kourosh
 
Posts: n/a

Default Re: How can I fix Big BUG in PersianCalendar Class? - 04-13-2006 , 11:48 AM



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


"Larry Lard" wrote:

Quote:
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 (AT) microsoft (DOT) 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



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.