In this program, we are going to share C# program to add two timespans with the output.
To increase your C# knowledge, practice all C sharp programs:
Copy the below c# program and execute it in your Microsoft Visual Studio IDE (Integrated Development Environment ). At the end of this program, I have shared the output program.
1 2 3 4 5 6 7 8 9 10 11 12 | using System; class Program { static void Main() { TimeSpan s1 = new TimeSpan(5, 0, 0); TimeSpan s2 = new TimeSpan(1, 45, 10); TimeSpan s3 = s1.Add(s2); Console.WriteLine(s3); Console.Read(); } } |
06:45:10
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.