When working with dates, I have been using DateTime2 type in SQL Server to store C# DateTime.
.NET 6 has introduced new structs such as DateOnly and TimeOnly. I assume these should be mapped to Date and Time.
Are there any corner cases when the conversion wouldn't be valid? Are these types fully compatible?
<input type="time" />
still usesTimeSpan
for the type). As such I personally have decided thatDateOnly
andTimeOnly
do not add enough value for me to introduce all the additional conversions. I will reassess when further support is added. This is of course entirely subjective. YMMV. – Silverware