static void Main(string[] args) { MyDate date1 = new MyDate(DateTime.Now); Console.WriteLine(date1.ToString()); MyDate date2 = new MyDate(new DateTime(2017, 12, 4)); Console.WriteLine(date2.ToString()); Console.WriteLine(MyDate.Sub(date1, date2).ToString()); Console.WriteLine(MyDate.Add(date1, date2).ToString()); // Delay. Console.ReadKey(); }
public static MyDate Add(MyDate d1, MyDate d2) { return(d1 + d2); }
public static MyDate Sub(MyDate d1, MyDate d2) { return(d1 - d2); }