Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

subtract two times c#

string startTime = "7:00 AM";
string endTime = "2:00 PM";

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

Console.WriteLine(duration);
Console.ReadKey();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #subtract #times
ADD COMMENT
Topic
Name
6+8 =