📜  减去两次 c# 代码示例

📅  最后修改于: 2022-03-11 14:49:11.780000             🧑  作者: Mango

代码示例1
string startTime = "7:00 AM";
string endTime = "2:00 PM";

TimeSpan duration = DateTime.Parse(endTime).Subtract(DateTime.Parse(startTime));

Console.WriteLine(duration);
Console.ReadKey();