DateOnly & TimeOnly .NET 6 引入了两种期待已久的类型 - DateOnly 和 TimeOnly, 它们分别代表DateTime的日期和时间部分. DateOnly dateOnly = new(2021, 9, 25); Console.WriteLine(dateOnly); TimeOnly timeOnly = new(19, 0, 0); Console.WriteLine(timeOnly); DateOnly dateOnlyFromDate = Date…