Share via

Should DateOnly Constructors Provide Exceptions?

Nicholas Piazza 546 Reputation points
2023-11-13T17:30:23.79+00:00

It seems like the System.DateOnly constructors should provide for some exceptions. What if someone enters a year outside the range 1-9999? What if they enter Feb 29 with a year that is not a leap year? What if they enter Feb 30 or Apr 31?

Developer technologies | .NET | Other

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.