TimeSpan.Subtract() মেথড বা - অপারেটর ব্যবহার করে দুটি TimeSpan বিয়োগ করা যায়।
উদাহরণ
using System;
public class Demo {
public static void Main() {
TimeSpan t1 = TimeSpan.FromMinutes(2);
TimeSpan t2 = TimeSpan.FromMinutes(1);
TimeSpan result = t1.Subtract(t2); // বা t1 - t2
Console.WriteLine("Result: " + result); // 00:01:00
}
}
আউটপুট
Result: 00:01:00