Since .NET 6 there are two new types available for dates and times: DateOnly and TimeOnly. These new converters supplement the existing DateTimeConverter.
The unit tests are based on DateTimeConverterTests. Some tests were removed because they used DateTimeKind and were identical to other tests after removing all irrelevant code. Some test cases using date/time formats were removed because they made no sense in that context, or because the formats are explicitly unsupported (i.e. throwing an exception) for DateOnly or TimeOnly.
The commented-out test cases fail, just like they do in DateTimeConverterTests. I'm not entirely sure why the various date/time format test cases exist, since they do not test additional code paths. But I've left them in for consistency.
Since .NET 6 there are two new types available for dates and times:
DateOnly
andTimeOnly
. These new converters supplement the existingDateTimeConverter
.The unit tests are based on
DateTimeConverterTests
. Some tests were removed because they usedDateTimeKind
and were identical to other tests after removing all irrelevant code. Some test cases using date/time formats were removed because they made no sense in that context, or because the formats are explicitly unsupported (i.e. throwing an exception) forDateOnly
orTimeOnly
. The commented-out test cases fail, just like they do inDateTimeConverterTests
. I'm not entirely sure why the various date/time format test cases exist, since they do not test additional code paths. But I've left them in for consistency.