![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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? |
#3
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |