Mega Code Archive

 
Categories / C# / Date Time
 

Subtract 15 minutes from the current TimeSpan and print the result

using System; using System.Collections.Generic; using System.Text; class Program {     static void Main(string[] args) {         TimeSpan ts = new TimeSpan(4, 30, 0);         Console.WriteLine(ts);         Console.WriteLine(ts.Subtract(new TimeSpan(0, 15, 0)));     } }