Dates & calendars

E

eschneider

Hello,

The minimum supported year acording to the HebrewCalendar is 5343

Then why do I get the following error when performing the following?:

new DateTime(5343,1,1,New HebrewCalendar)

System.ArgumentOutOfRangeException occurred
Message="Specified time is not supported in this calendar. It should be
between 01/01/1583 00:00:00 (Gregorian date) and 09/29/2239 23:59:59
(Gregorian date), inclusive. Parameter name: time"
ParamName="time"
Source="mscorlib"
StackTrace:
at System.Globalization.HebrewCalendar.CheckTicksRange(Int64 ticks)
at System.Globalization.HebrewCalendar.ToDateTime(Int32 year, Int32
month, Int32 day, Int32 hour, Int32 minute, Int32 second, Int32 millisecond,
Int32 era)
at System.Globalization.Calendar.ToDateTime(Int32 year, Int32 month,
Int32 day, Int32 hour, Int32 minute, Int32 second, Int32 millisecond)
at System.DateTime..ctor(Int32 year, Int32 month, Int32 day, Calendar
calendar)
at SchneiderSoft.AbstractInterfaces.DateTimeCalendar.ToDateTime() in
E:\SchneiderSoftware\SchneiderSoft.UIControls\AbstractInterfaces\DateTimeCalendar.vb:line
132
InnerException:
 
J

Jeroen Mostert

eschneider said:
The minimum supported year acording to the HebrewCalendar is 5343

Then why do I get the following error when performing the following?:

new DateTime(5343,1,1,New HebrewCalendar)
Because the minimum *date* in the Hebrew calendar supported by .NET is
5343-04-07. Anything before that goes before 1583-01-01 (Gregorian) and is
therefore not supported.
 
L

Lingzhi Sun [MSFT]

Thank you very much, Jeroen, for your post.

Hello eschneider,

Thank you for using Microsoft Newsgroup Support service. My name is
Lingzhi Sun [MSFT]. I am very glad to work with you on this thread.

The HebrewCalendar class in .NET Framework only supports the date between
01/01/1583 00:00:00 (Gregorian Date) and 09/29/2239 23:59:59 (Gregorian
Date). We can retrieve these values by calling
HebrewCalendar.MinSupportedDateTime and
HebrewCalendar.MaxSupportedDateTime. For detail, please see
http://msdn.microsoft.com/en-us/library/system.globalization.hebrewcalendar_
members.aspx.

To convert these Gregorian Date to Hebrew Calendar, you can refer to this
tool:
http://www.hebcal.com/converter/?gd=1&gm=1&gy=1583&g2h=Compute+Hebrew+Date&h
d=12&hm=Nisan&hy=5769.

Gregorian Date ------ Hebrew Calendar
1583/01/01 5343/04(Tevet)/07
2239/09/29 5999/13(Elul)/29

If you have any other questions, please be free to let me know.


Regards,
Lingzhi Sun ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

MSDN Managed Newsgroup support offering is for non-urgent issues where an
initial response from the community or a Microsoft Support Engineer within
2 business day is acceptable. Please note that each follow up response may
take approximately 2 business days as the support professional working with
you may need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations that require urgent,
real-time or phone-based interactions. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
E

eschneider

Thanks, Guys

I did not realize it was the month and day, seems strange not to support the
full year of 5343.

Also I think the error message sucks. It should show the valid Hebrew dates
not Gregorian.
Likewise the debugger always shows the dates as Gregorian, making any
trouble shooting a pain.

Thanks,
Eric
 
L

Lingzhi Sun [MSFT]

Hi Eric,

Thank you very much for your feedback.

The HebrewCalendar in .NET Framework supports the Gregorian Date from
1583/01/01 to 2239/09/29. So it only supports the corresponding date in
Hebrew Calendar from 5343/04/07 to 5999/13/09. I think that is why the
HebrewCalendar class cannot support the whole year of 5343 in Hebrew
Calendar.

For the error message, I think your request is quite reasonable. It is my
pleasure to help send a wish to our product designers via internal channel.
You are also welcome to add your supplements to make Microsoft products
easier and more powerful to use by submitting a ticket in
https://connect.microsoft.com/VisualStudio. As we strive to capture any
and all product feedback so as to ensure that we are continuously
developing Microsoft products to meet customer needs, feedback such as
yours is always taken very seriously. It is appreciated that you can paste
the suggestion's link here after you submit the ticket in
https://connect.microsoft.com/VisualStudio, so that other community members
can benefit from it.


Regards,
Lingzhi Sun ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 
L

Lingzhi Sun [MSFT]

Hi Eric,

Thank you so much for posting these feedback links. It will definitely
benefit other community members.

Thank you again for using Microsoft Newsgroup Support service. Have a
great day!


Regards,
Lingzhi Sun ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 
E

eschneider

They always ignore me...

Here is the reply:
Thank you for sneinding your suggestion for improving the behavior of the
calendar classes provided by the Microsoft .NET framework. This particular
scenario is considered as by design because the exception message uses the
invariant culture to show the error message. Accordingly, what you are
seeing is the expected behavior for this class. Thanks again for reporting
this suggestion and we hope that you enjoy all the globalization functions
in the framework.
Posted by Microsoft on 4/22/2009 at 1:33 PM

My reply:
Well , my argument is that it is a crappy design. But this is exactly the
reply I expected. Every response I get from MS is this is by design. That
does not mean it is correct!

Eric Schneider
 
L

Lingzhi Sun [MSFT]

Hi Eric,

I have reported this issue to the corresponding product unit. You may have
seen the new feedback from the product team.

For detail, please see
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Feedba
ckID=433599

Thank you again for your suggestions!

Have a nice day!

Regards,
Lingzhi Sun ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top