DateTime.Equals(DateTime first, DateTime second) : DateTime « System « C# / C Sharp by API






DateTime.Equals(DateTime first, DateTime second)

    

using System;

class MainClass
{
  public static void Main()
  {
    DateTime myDateTime3 = new DateTime(2004, 1, 13);
    DateTime myDateTime4 = new DateTime(2004, 1, 14);
    Console.WriteLine("myDateTime3 = " + myDateTime3);
    Console.WriteLine("myDateTime4 = " + myDateTime4);
    
    
    bool boolResult = DateTime.Equals(myDateTime3, myDateTime4);
    Console.WriteLine("DateTime.Equals(myDateTime3, myDateTime4) = " + boolResult);
    boolResult = myDateTime3.Equals(myDateTime4);
    Console.WriteLine("myDateTime3.Equals(myDateTime4) is " + boolResult);
  }

}

   
    
    
    
  








Related examples in the same category

1.new DateTime
2.new DateTime(0)
3.new DateTime(year, month, day, hour, minute, second, millisecond)
4.DateTime < DateTime
5.DateTime - TimeSpan
6.DateTime.Add(TimeSpan)
7.DateTime.AddSeconds
8.DateTime.AddYears
9.DateTime.Compare(DateTime first, DateTime second)
10.DateTime.Date
11.DateTime.DayOfWeek
12.DateTime.DaysInMonth
13.DateTime.Equals(DateTime dt)
14.DateTime.FromFileTime
15.DateTime.IsDaylightSavingTime()
16.DateTime.IsLeapYear
17.DateTime.Kind
18.DateTime.MaxValue
19.DateTime.Millisecond
20.DateTime.Now
21.DateTime.Parse
22.DateTime.ParseExact
23.DateTime.Second
24.DateTime.Subtract(TimeSpan t)
25.DateTime.Ticks
26.DateTime.TimeOfDay
27.DateTime.Today
28.DateTime.ToFileTime
29.DateTime.ToLongDateString()
30.DateTime.ToLongTimeString()
31.DateTime.ToShortDateString()
32.DateTime.ToShortTimeString()
33.DateTime.ToString(String format)
34.DateTime.ToString(String format, CultureInfo ci)
35.DateTime.UtcNow
36.DateTime.Year