asp.net.ph

DateTime.Equals Method

System Namespace   DateTime Structure


Returns a value indicating whether an instance of DateTime is equal to a specified object.

Overload List

1. Returns a value indicating whether this instance is equal to a specified object.

2. Returns a value indicating whether two instances of DateTime are equal.


Example

The below code snippet demonstrates using the Equals method.

NOTE: This example shows how to use one of the overloaded versions of Equals. For other examples that might be available, see the individual overload topics.

System.DateTime today1 =
      new System.DateTime ( System.DateTime.Today.Ticks );
System.DateTime today2 =
      new System.DateTime ( System.DateTime.Today.Ticks );
System.DateTime tomorrow =
      new System.DateTime (
               System.DateTime.Today.AddDays ( 1 ).Ticks );

// todayEqualsToday gets true.
bool todayEqualsToday = System.DateTime.Equals ( today1, today2 );

// todayEqualsTomorrow gets false.
bool todayEqualsTomorrow = System.DateTime.Equals ( today1, tomorrow );
  C# VB

See Also

DateTime Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph