C# 日期时间转换

SaltyLeo at 
C# 日期时间转换的配图
以备自己以后忘记了,先备份记录一下这些示例代码: DateTime testDateTime = new DateTime(2022, 12, 10, 10, 50, 30); testDateTime.Dump(\"《测试用》日期时间(DateTime)\"); TimeOnly testTimeOnly = TimeOnly.Parse(\"10:00 PM\"); testTimeOnly.Dump(\"《测试用》时间(TimeOnly)\"); DateOnly testDateOnly = new DateOnly(2022, 11, 11); t……