C# DateTime GreaterThanOrEqual
Description
DateTime GreaterThanOrEqual
determines whether one
specified DateTime represents a date and time that is the same as or later
than another specified DateTime.
Syntax
DateTime.GreaterThanOrEqual
has the following syntax.
public static bool operator >=(
DateTime t1,
DateTime t2
)
Parameters
DateTime.GreaterThanOrEqual
has the following parameters.
t1
- The first object to compare.t2
- The second object to compare.
Returns
DateTime.GreaterThanOrEqual
method returns true if t1 is the same as or later than t2; otherwise, false.
Example
The following code shows how to use DateTime.GreaterThanOrEqual
operator.
using System;/* w w w .j a v a2 s . co m*/
public class MainClass{
public static void Main(String[] argv){
System.DateTime april19 = new DateTime(2001, 4, 19);
System.DateTime otherDate = new DateTime(1991, 6, 5);
bool result = april19 >= otherDate;
System.Console.WriteLine(result);
otherDate = new DateTime(2001, 4, 19);
result = april19 >= otherDate;
System.Console.WriteLine(result);
}
}
The code above generates the following result.