The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DateTime.LessThan Operator (DateTime, DateTime)


Determines whether one specified DateTime is earlier than another specified DateTime.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

public static bool operator <(
	DateTime t1,
	DateTime t2


Type: System.DateTime

The first object to compare.

Type: System.DateTime

The second object to compare.

Return Value

Type: System.Boolean

true if t1 is earlier than t2; otherwise, false.

The LessThan operator determines the relationship between two DateTime values by comparing their number of ticks. Before comparing DateTime objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their Kind property.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
© 2015 Microsoft